mirror of
https://github.com/mitb-archive/filebot
synced 2025-01-10 21:38:04 -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());
|
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.
|
* Pattern used for matching file extensions.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user