mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-23 08:18:52 -05:00
equalsFileContent
This commit is contained in:
parent
a442f32ae3
commit
6b4e5bfbe0
@ -274,6 +274,27 @@ public final class FileUtilities {
|
||||
return a.getPath().equals(b.getPath());
|
||||
}
|
||||
|
||||
public static boolean equalsFileContent(File a, File b) {
|
||||
// must have the same file size
|
||||
if (a.length() != b.length()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// must not be a folder
|
||||
if (a.isDirectory() || b.isDirectory()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// must be equal byte by byte
|
||||
try {
|
||||
return FileUtils.contentEquals(a, b);
|
||||
} catch (Exception e) {
|
||||
log.warning(cause(e));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pattern used for matching file extensions.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user