From a2da311441fc682629c38435038d7d3be855507f Mon Sep 17 00:00:00 2001 From: Laszlo Csomor Date: Wed, 7 Sep 2016 08:06:15 +0000 Subject: Windows, tests: move code into WindowsTestUtil Additionally: - clean up the corresponding BUILD file a bit - add a comment to Path A subsequent change will add tests for WindowsFileSystem, then fix a bug there. -- MOS_MIGRATED_REVID=132408212 --- .../java/com/google/devtools/build/lib/vfs/Path.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/google/devtools/build/lib/vfs/Path.java b/src/main/java/com/google/devtools/build/lib/vfs/Path.java index c6245b0e65..532a5f022a 100644 --- a/src/main/java/com/google/devtools/build/lib/vfs/Path.java +++ b/src/main/java/com/google/devtools/build/lib/vfs/Path.java @@ -20,7 +20,6 @@ import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe; import com.google.devtools.build.lib.util.OS; import com.google.devtools.build.lib.util.Preconditions; import com.google.devtools.build.lib.util.StringCanonicalizer; - import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; @@ -797,15 +796,18 @@ public class Path implements Comparable, Serializable { public void createSymbolicLink(PathFragment target) throws IOException { fileSystem.createSymbolicLink(this, target); } - + /** - * Returns the target of the current path, which must be a symbolic link. The - * link contents are returned exactly, and may contain an absolute or relative - * path. Analogous to readlink(2). + * Returns the target of the current path, which must be a symbolic link. The link contents are + * returned exactly, and may contain an absolute or relative path. Analogous to readlink(2). + * + *

Note: for {@link FileSystem}s where {@link FileSystem#supportsSymbolicLinksNatively()} + * returns false, this method will throw an {@link UnsupportedOperationException} if the link + * points to a non-existent file. * * @return the content (i.e. target) of the symbolic link - * @throws IOException if the current path is not a symbolic link, or the - * contents of the link could not be read for any reason + * @throws IOException if the current path is not a symbolic link, or the contents of the link + * could not be read for any reason */ public PathFragment readSymbolicLink() throws IOException { return fileSystem.readSymbolicLink(this); -- cgit v1.2.3