Commit 11553bdb authored by Petri Hintukainen's avatar Petri Hintukainen

split checkRead()

parent c48cbbe4
...@@ -177,6 +177,21 @@ final class BDJSecurityManager extends SecurityManager { ...@@ -177,6 +177,21 @@ final class BDJSecurityManager extends SecurityManager {
* file read access * 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) { public void checkRead(String file) {
file = getCanonPath(file); file = getCanonPath(file);
...@@ -185,13 +200,7 @@ final class BDJSecurityManager extends SecurityManager { ...@@ -185,13 +200,7 @@ final class BDJSecurityManager extends SecurityManager {
BDJLoader.accessFile(file); BDJLoader.accessFile(file);
} }
if (cacheRoot != null && file.startsWith(cacheRoot)) { if (canRead(file)) {
return;
}
else if (discRoot != null && file.startsWith(discRoot)) {
return;
}
else if (canReadWrite(file)) {
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment