diff options
author | Googler <noreply@google.com> | 2016-09-07 14:33:29 +0000 |
---|---|---|
committer | Yun Peng <pcloudy@google.com> | 2016-09-08 08:43:41 +0000 |
commit | e1cd9509862aef684b4dbbdfd15d0b877fb8fad3 (patch) | |
tree | abc9f51fa1ecdb86854b0c39ae56dd6844cc0eb6 /src/main/java/com/google/devtools/build/lib/vfs/JavaIoFileSystem.java | |
parent | 0d3e8ae7c2bd6937bc0ffd32963d6635bfe825f5 (diff) |
Fixed the issue that hard links are handled improperly when bazel decompresses tarballs.
Issue link: https://github.com/bazelbuild/bazel/issues/574
--
MOS_MIGRATED_REVID=132434278
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/vfs/JavaIoFileSystem.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/vfs/JavaIoFileSystem.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/vfs/JavaIoFileSystem.java b/src/main/java/com/google/devtools/build/lib/vfs/JavaIoFileSystem.java index dead488021..7cc10aa8eb 100644 --- a/src/main/java/com/google/devtools/build/lib/vfs/JavaIoFileSystem.java +++ b/src/main/java/com/google/devtools/build/lib/vfs/JavaIoFileSystem.java @@ -191,6 +191,11 @@ public class JavaIoFileSystem extends AbstractFileSystemWithCustomStat { } @Override + public boolean supportsHardLinksNatively() { + return true; + } + + @Override public boolean isFilePathCaseSensitive() { return true; } @@ -468,4 +473,12 @@ public class JavaIoFileSystem extends AbstractFileSystemWithCustomStat { throw new IllegalStateException(e); } } + + @Override + protected void createFSDependentHardLink(Path linkPath, Path originalPath) + throws IOException { + Files.createLink( + java.nio.file.Paths.get(linkPath.toString()), + java.nio.file.Paths.get(originalPath.toString())); + } } |