diff options
author | 2017-09-14 14:36:44 +0200 | |
---|---|---|
committer | 2017-09-14 18:48:10 +0200 | |
commit | 5ef576fc95699af3ce1199ad51c23be8b96258f6 (patch) | |
tree | cf1bbe7dc2b0196fd91cece8655a2a21cc06802f /src/main/java/com/google/devtools/build/lib/buildeventstream | |
parent | f26e8694ae78599b3e2004e3360eaf3443fa53a6 (diff) |
bep: Properly URI encode file paths
RELNOTES: The Build Event Protocol's File.uri field is now properly
encoded according to RFC2396.
PiperOrigin-RevId: 168674865
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/buildeventstream')
2 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto b/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto index 0fa0b4a15c..472f104ecc 100644 --- a/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto +++ b/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto @@ -340,7 +340,8 @@ message File { string name = 1; oneof file { - // A location where the contents of the file can be found. + // A location where the contents of the file can be found. The string is + // encoded according to RFC2396. string uri = 2; // The contents of the file, if they are guaranteed to be short. bytes contents = 3; diff --git a/src/main/java/com/google/devtools/build/lib/buildeventstream/transports/BuildEventTransportFactory.java b/src/main/java/com/google/devtools/build/lib/buildeventstream/transports/BuildEventTransportFactory.java index a28645dedb..d07f6a59ea 100644 --- a/src/main/java/com/google/devtools/build/lib/buildeventstream/transports/BuildEventTransportFactory.java +++ b/src/main/java/com/google/devtools/build/lib/buildeventstream/transports/BuildEventTransportFactory.java @@ -101,7 +101,7 @@ public enum BuildEventTransportFactory { private static class NullPathConverter implements PathConverter { @Override public String apply(Path path) { - return "file://" + path; + return path.toURI().toString(); } } } |