aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/vfs/FileSystem.java
diff options
context:
space:
mode:
authorGravatar tomlu <tomlu@google.com>2017-12-08 14:19:42 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2017-12-08 14:23:59 -0800
commitc2f6ae8f61b15c621323b62665b324ad21d59f32 (patch)
tree2496ec0d1f59cea23b7965a0547169e30bd3e14b /src/main/java/com/google/devtools/build/lib/vfs/FileSystem.java
parentf35c8a0dfb74f7b0d7b292d5a23eb7ce10723954 (diff)
Thread filesystem through codebase.
RELNOTES: None PiperOrigin-RevId: 178426166
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.java20
1 files changed, 12 insertions, 8 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 6386b738b1..33fb154fdd 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
@@ -284,10 +284,10 @@ public abstract class FileSystem {
protected abstract long getLastModifiedTime(Path path, boolean followSymlinks) throws IOException;
/**
- * Sets the last modification time of the file denoted by {@code path}. See
- * {@link Path#setLastModifiedTime} for specification.
+ * Sets the last modification time of the file denoted by {@code path}. See {@link
+ * Path#setLastModifiedTime} for specification.
*/
- protected abstract void setLastModifiedTime(Path path, long newTime) throws IOException;
+ public abstract void setLastModifiedTime(Path path, long newTime) throws IOException;
/**
* Returns value of the given extended attribute name or null if attribute
@@ -304,7 +304,7 @@ public abstract class FileSystem {
* system does not support extended attributes at all.
* @throws IOException if the call failed for any other reason.
*/
- protected byte[] getxattr(Path path, String name) throws IOException {
+ public byte[] getxattr(Path path, String name) throws IOException {
return null;
}
@@ -605,6 +605,11 @@ public abstract class FileSystem {
return readSymbolicLink(path);
}
+ /** Returns true iff this path denotes an existing file of any kind. Follows symbolic links. */
+ public boolean exists(Path path) {
+ return exists(path, true);
+ }
+
/**
* Returns true iff {@code path} denotes an existing file of any kind. See
* {@link Path#exists(Symlinks)} for specification.
@@ -751,11 +756,10 @@ public abstract class FileSystem {
protected abstract OutputStream getOutputStream(Path path, boolean append) throws IOException;
/**
- * Renames the file denoted by "sourceNode" to the location "targetNode".
- * See {@link Path#renameTo} for specification.
+ * Renames the file denoted by "sourceNode" to the location "targetNode". See {@link
+ * Path#renameTo} for specification.
*/
- protected abstract void renameTo(Path sourcePath, Path targetPath) throws IOException;
-
+ public abstract void renameTo(Path sourcePath, Path targetPath) throws IOException;
/**
* Create a new hard link file at "linkPath" for file at "originalPath".