diff options
author | 2015-09-16 21:31:49 +0000 | |
---|---|---|
committer | 2015-09-17 19:32:26 +0000 | |
commit | 215974e543a04cae00db564695b5a00fd326288c (patch) | |
tree | e9185977d69d533cec76fd7e6c26881797bbac0a /src/main/java/com/google/devtools/build/lib/vfs/FileSystem.java | |
parent | e0c6df7939452aba830c5a8bfffc87c83cd03145 (diff) |
Introduce Path#readSymbolicLinkUnchecked, intended to only be used when the caller already knows the path is a symlink, and use this new method throughout the codebase.
--
MOS_MIGRATED_REVID=103229983
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/vfs/FileSystem.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/vfs/FileSystem.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/vfs/FileSystem.java b/src/main/java/com/google/devtools/build/lib/vfs/FileSystem.java index fc5a9e81e3..bf74b96f62 100644 --- a/src/main/java/com/google/devtools/build/lib/vfs/FileSystem.java +++ b/src/main/java/com/google/devtools/build/lib/vfs/FileSystem.java @@ -478,6 +478,17 @@ public abstract class FileSystem { protected abstract PathFragment readSymbolicLink(Path path) throws IOException; /** + * Returns the target of a symbolic link, under the assumption that the given path is indeed a + * symbolic link (this assumption permits efficient implementations). See + * {@link Path#readSymbolicLinkUnchecked} for specification. + * + * @throws IOException if the contents of the link could not be read for any reason. + */ + protected PathFragment readSymbolicLinkUnchecked(Path path) throws IOException { + return readSymbolicLink(path); + } + + /** * Returns true iff {@code path} denotes an existing file of any kind. See * {@link Path#exists(Symlinks)} for specification. */ |