Avoid opening 0 byte test files as real archives
This commit is contained in:
parent
dcf3c4931c
commit
565555e0b3
|
@ -104,14 +104,20 @@ public class ScriptShellMethods {
|
||||||
return ARCHIVE_FILES.accept(self);
|
return ARCHIVE_FILES.accept(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isDisk(File self) throws Exception {
|
public static boolean isDisk(File self) {
|
||||||
// check disk folder
|
// check disk folder
|
||||||
if (self.isDirectory() && MediaDetection.isDiskFolder(self))
|
if (self.isDirectory() && MediaDetection.isDiskFolder(self)) {
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// check disk image
|
// check disk image
|
||||||
if (self.isFile() && MediaTypes.getDefaultFilter("video/iso").accept(self) && MediaDetection.isVideoDiskFile(self))
|
if (self.isFile() && MediaTypes.getDefaultFilter("video/iso").accept(self)) {
|
||||||
return true;
|
try {
|
||||||
|
return MediaDetection.isVideoDiskFile(self);
|
||||||
|
} catch (Exception e) {
|
||||||
|
debug.log(Level.WARNING, format("Failed to read disk image: %s: %s", self, e));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue