[libbluray-devel] Fix caching JAR/ subdirectory from UDF filesystem

hpi1 git at videolan.org
Mon Apr 6 18:16:46 CEST 2015


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Apr  6 19:07:14 2015 +0300| [4c98726711c1240fd40362d8a92107f5e6cc32f8] | committer: hpi1

Fix caching JAR/ subdirectory from UDF filesystem

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=4c98726711c1240fd40362d8a92107f5e6cc32f8
---

 src/libbluray/bdj/java/org/videolan/VFSCache.java |   29 ++++++++++++++-------
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/src/libbluray/bdj/java/org/videolan/VFSCache.java b/src/libbluray/bdj/java/org/videolan/VFSCache.java
index 47b2184..2bcfbe9 100644
--- a/src/libbluray/bdj/java/org/videolan/VFSCache.java
+++ b/src/libbluray/bdj/java/org/videolan/VFSCache.java
@@ -159,20 +159,29 @@ class VFSCache {
         logger.info("cached " + relPath);
     }
 
-    private void copyJarDir(String name) {
-        /* copy directory from BDMV/JAR/ */
+    private void copyJarDir(String name, String[] files) {
 
-        File[] files = new File(vfsRoot + jarDir + name).listFiles();
         for (int i = 0; i < files.length; i++) {
-            File   file    = files[i];
-            String relPath = name + File.separator + files[i].getName();
-            if (file.isDirectory()) {
-                copyJarDir(relPath);
+            String relPath = name + File.separator + files[i];
+            String[] subFiles = Libbluray.listBdFiles(relPath, true);
+            if (subFiles != null) {
+                copyJarDir(relPath, subFiles);
             } else {
-                copyJarFile(relPath);
+                Libbluray.cacheBdRomFile(relPath, cacheRoot + relPath);
             }
         }
-        logger.info("cached " + name);
+    }
+
+    private void copyJarDir(String name) {
+        /* copy directory from BDMV/JAR/ */
+
+        String relPath = jarDir + name;
+        String[] files = Libbluray.listBdFiles(relPath, true);
+        if (files == null) {
+            return;
+        }
+        copyJarDir(relPath, files);
+        logger.info("cached " + relPath);
     }
 
     /*
@@ -281,7 +290,7 @@ class VFSCache {
         }
 
         String relPath = absPath.substring(vfsRootLength);
-        String[] names = org.videolan.Libbluray.listBdFiles(relPath, true);
+        String[] names = Libbluray.listBdFiles(relPath, true);
         if (names != null) {
             /* this is directory */
             return;



More information about the libbluray-devel mailing list