<div dir="ltr">I'm not sure how to propose a patch as I don't see any recent examples, but I've included what I'd like to push below. Please let me know what the best way to contribute to this project is—I didn't see any guidelines at <a href="http://www.videolan.org/developers/libbluray.html">http://www.videolan.org/developers/libbluray.html</a>, but I may have missed something obvious.<div><br></div><div>[PATCH] Fix Java 8 build break with getFileSystem()<br></div><div><br></div><div><div>Unfortunately java.io.FileSystem.getFileSystem() was removed in Java 8,</div><div>so the addition of calls to it in 7fc6531ea0 broke compilation under Java 8</div><div>---</div><div> src/libbluray/bdj/java/java/io/BDFileSystem.java | 21 ++++++++++++++++++---</div><div> 1 file changed, 18 insertions(+), 3 deletions(-)</div><div><br></div><div>diff --git a/src/libbluray/bdj/java/java/io/BDFileSystem.java b/src/libbluray/bdj/java/java/io/BDFileSystem.java</div><div>index 9800022..a6892a5 100644</div><div>--- a/src/libbluray/bdj/java/java/io/BDFileSystem.java</div><div>+++ b/src/libbluray/bdj/java/java/io/BDFileSystem.java</div><div>@@ -42,6 +42,8 @@ public abstract class BDFileSystem extends FileSystem {</div><div><br></div><div>     protected final FileSystem fs;</div><div><br></div><div>+    private static FileSystem nativeFileSystem;</div><div>+</div><div>     public static void init(Class c) {</div><div>         Field filesystem;</div><div>         try {</div><div>@@ -62,18 +64,31 @@ public abstract class BDFileSystem extends FileSystem {</div><div>         } catch (Throwable t) {</div><div>             System.err.print("Hooking FileSystem class failed: " + t);</div><div>         }</div><div>+        /* Java 8: getFileSystem() no longer exists on java.io.FileSystem */</div><div>+        try {</div><div>+            Class.forName("java.io.DefaultFileSystem");</div><div>+            nativeFileSystem = DefaultFileSystem.getFileSystem();</div><div>+        } catch (ClassNotFoundException e) {</div><div>+            try {</div><div>+                nativeFileSystem = (FileSystem)FileSystem.class</div><div>+                    .getDeclaredMethod("getFileSystem",new Class[0])</div><div>+                    .invoke(FileSystem.class, new Object[0]);</div><div>+            } catch (Throwable t) {</div><div>+                System.err.print("Couldn't find native filesystem: " + t);</div><div>+            }</div><div>+        }</div><div>     }</div><div><br></div><div>     public static String[] nativeList(File f) {</div><div>-        return getFileSystem().list(f);</div><div>+        return nativeFileSystem.list(f);</div><div>     }</div><div><br></div><div>     public static boolean nativeFileExists(String path) {</div><div>-        return getFileSystem().getBooleanAttributes(new File(path)) != 0;</div><div>+        return nativeFileSystem.getBooleanAttributes(new File(path)) != 0;</div><div>     }</div><div><br></div><div>     public static boolean nativeDelete(File f) {</div><div>-        return getFileSystem().delete(f);</div><div>+        return nativeFileSystem.delete(f);</div><div>     }</div><div><br></div><div>     /*</div><div>--</div></div></div>