[libbluray-devel] split checkRead()

hpi1 git at videolan.org
Fri Mar 27 12:49:06 CET 2015


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Fri Mar 27 13:21:00 2015 +0200| [11553bdbc75413831dc32f4bb4115333b50498bb] | committer: hpi1

split checkRead()

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

 .../bdj/java/org/videolan/BDJSecurityManager.java  |   23 ++++++++++++++------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java b/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java
index 10d7edc..c125358 100644
--- a/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java
+++ b/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java
@@ -177,6 +177,21 @@ final class BDJSecurityManager extends SecurityManager {
      * file read access
      */
 
+    private boolean canRead(String file) {
+
+        if (cacheRoot != null && file.startsWith(cacheRoot)) {
+            return true;
+        }
+        if (discRoot != null && file.startsWith(discRoot)) {
+            return true;
+        }
+        if (canReadWrite(file)) {
+            return true;
+        }
+
+        return false;
+    }
+
     public void checkRead(String file) {
 
         file = getCanonPath(file);
@@ -185,13 +200,7 @@ final class BDJSecurityManager extends SecurityManager {
             BDJLoader.accessFile(file);
         }
 
-        if (cacheRoot != null && file.startsWith(cacheRoot)) {
-            return;
-        }
-        else if (discRoot != null && file.startsWith(discRoot)) {
-            return;
-        }
-        else if (canReadWrite(file)) {
+        if (canRead(file)) {
             return;
         }
 



More information about the libbluray-devel mailing list