diff options
author | Laszlo Csomor <laszlocsomor@google.com> | 2016-09-07 08:06:15 +0000 |
---|---|---|
committer | Yue Gan <yueg@google.com> | 2016-09-07 10:42:50 +0000 |
commit | a2da311441fc682629c38435038d7d3be855507f (patch) | |
tree | 281a5eadc6d0b4a26d363816b79f7d8e86ccc99a /src/main/java | |
parent | fde49114ca129ce3ac77753fcde90075b6571778 (diff) |
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
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/vfs/Path.java | 16 |
1 files changed, 9 insertions, 7 deletions
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<Path>, 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). + * + * <p>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); |