diff options
author | 2017-09-11 09:34:05 +0200 | |
---|---|---|
committer | 2017-09-11 13:07:41 +0200 | |
commit | 9f7df7065d57fde37fd5e9f63cdcfe949389702c (patch) | |
tree | 611b7508b06b43d9526241d00b4862bfa25b2b22 | |
parent | e92e3d8a4fcab49cda1a2bebc02d5119798d5258 (diff) |
Automated rollback of commit f5a0b380aadf3dd976b45fd19b2dd5150ced8f41.
*** Reason for rollback ***
Breaks BEP parsing in IntelliJ (b/65521927).
*** Original change description ***
bep: encode file paths in URI format
We need to ensure that special characters are encoded according to the
URI specification RFC2396.
Change-Id: Ie93cbe11a70f448d2e7bacd0bba5699ec20cac25
PiperOrigin-RevId: 168195227
3 files changed, 4 insertions, 6 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/buildeventstream/PathConverter.java b/src/main/java/com/google/devtools/build/lib/buildeventstream/PathConverter.java index 473f019495..e230d36953 100644 --- a/src/main/java/com/google/devtools/build/lib/buildeventstream/PathConverter.java +++ b/src/main/java/com/google/devtools/build/lib/buildeventstream/PathConverter.java @@ -20,8 +20,8 @@ import com.google.devtools.build.lib.vfs.Path; */ public interface PathConverter { /** - * Returns a URI according to RFC2396 corresponding to the given path, if the path can be - * converted to a URI by this path converter; return {@code null} otherwise. + * Return the URI corresponding to the given path, if the path can be converted to a URI by this + * path converter; return {@link null} otherwise. */ String apply(Path path); } 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 472f104ecc..0fa0b4a15c 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,8 +340,7 @@ message File { string name = 1; oneof file { - // A location where the contents of the file can be found. The string is - // encoded according to RFC2396. + // A location where the contents of the file can be found. 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 dd8e2a7714..a28645dedb 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 @@ -21,7 +21,6 @@ import com.google.common.collect.ImmutableSet.Builder; import com.google.devtools.build.lib.buildeventstream.BuildEventTransport; import com.google.devtools.build.lib.buildeventstream.PathConverter; import com.google.devtools.build.lib.vfs.Path; -import java.io.File; import java.io.IOException; /** Factory used to create a Set of BuildEventTransports from BuildEventStreamOptions. */ @@ -102,7 +101,7 @@ public enum BuildEventTransportFactory { private static class NullPathConverter implements PathConverter { @Override public String apply(Path path) { - return new File(path.getPathString()).toURI().toString(); + return "file://" + path; } } } |