8165323: (fs) Files.getFileStore fails with "Mount point not found" in chroot environment
Summary: Replace use of FileStore with FileSystem equivalent code.
Reviewed-by: redestad
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java Thu Sep 15 16:05:51 2016 -0400
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java Thu Sep 15 13:11:16 2016 -0700
@@ -189,7 +189,8 @@
storeFiles(modules, release);
- if (Files.getFileStore(root).supportsFileAttributeView(PosixFileAttributeView.class)) {
+ if (root.getFileSystem().supportedFileAttributeViews()
+ .contains("posix")) {
// launchers in the bin directory need execute permission.
// On Windows, "bin" also subdirectories containing jvm.dll.
if (Files.isDirectory(bin)) {
@@ -302,8 +303,8 @@
StandardOpenOption.CREATE_NEW)) {
writer.write(sb.toString());
}
- if (Files.getFileStore(root.resolve("bin"))
- .supportsFileAttributeView(PosixFileAttributeView.class)) {
+ if (root.resolve("bin").getFileSystem()
+ .supportedFileAttributeViews().contains("posix")) {
setExecutable(cmd);
}
// generate .bat file for Windows