diff options
author | tomlu <tomlu@google.com> | 2017-12-21 08:59:51 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2017-12-21 09:01:56 -0800 |
commit | decca2bd97f6a7eb6b2ca0412ddc792d57f0f424 (patch) | |
tree | 759006fa2a07d44d7a30f25ff3e9fc89370a229c /src/main/java/com/google/devtools/build/lib/vfs/ReadonlyFileSystemWithCustomStat.java | |
parent | 8fb14d5871088e32078812f21ef24189729e38cc (diff) |
Add FileSystem#createDirectoryAndParents.
A native implementation of this (instead of using FileSystemUtils, which can only use public interfaces) should be more efficient and more easy to make correct.
In particular, it should allow removing FileSystemUtils#createDirectoriesAndParents, which has poor thread safety characteristics. The latter method has a lot of logic that forces certain unnatural atomicity guarantees on createDirectory, and it also has logic that is conditional on sub-string content of exception messages.
PiperOrigin-RevId: 179819623
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/vfs/ReadonlyFileSystemWithCustomStat.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/vfs/ReadonlyFileSystemWithCustomStat.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/vfs/ReadonlyFileSystemWithCustomStat.java b/src/main/java/com/google/devtools/build/lib/vfs/ReadonlyFileSystemWithCustomStat.java index de5daca181..f9ca4ebb87 100644 --- a/src/main/java/com/google/devtools/build/lib/vfs/ReadonlyFileSystemWithCustomStat.java +++ b/src/main/java/com/google/devtools/build/lib/vfs/ReadonlyFileSystemWithCustomStat.java @@ -76,6 +76,11 @@ public abstract class ReadonlyFileSystemWithCustomStat extends AbstractFileSyste } @Override + public void createDirectoryAndParents(Path path) throws IOException { + throw modificationException(); + } + + @Override protected void createSymbolicLink(Path linkPath, PathFragment targetFragment) throws IOException { throw modificationException(); } |