8165323: (fs) Files.getFileStore fails with "Mount point not found" in chroot environment
authorbpb
Thu, 15 Sep 2016 13:11:16 -0700
changeset 40980 5f1dcd51e963
parent 40979 df846f0570fc
child 40981 805dd7bef81f
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
jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java
--- 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