public class FileCompare
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
FileCompare.Result
Class contains the comparison result for two files or sub directories in both trees.
|
Modifier and Type | Field and Description |
---|---|
(package private) static int |
content |
(package private) long |
minDiffTimestamp |
(package private) int |
mode |
(package private) static int |
onlyTimestamp |
(package private) java.lang.String[] |
sIgnores |
static java.lang.String |
version
Version and history
2019-12-04 Hartmut main now able to use with some more arguments.
|
(package private) static int |
withoutComment |
(package private) static int |
withoutEndlineComment |
(package private) static int |
withoutLineend |
Constructor and Description |
---|
FileCompare(int mode,
java.lang.String[] ignores,
long minDiffTimestamp) |
Modifier and Type | Method and Description |
---|---|
void |
compare(FileCompare.Result result,
java.lang.String[] sExclude,
int recursion)
Compares two directory trees.
|
(package private) void |
compareFile(FileCompare.Result file)
Compare two files.
|
(package private) boolean |
compareFileContent(FileCompare.Result result)
Compare two files.
|
static void |
main(java.lang.String[] args)
Compares directory trees
|
(package private) void |
reportResult(java.io.PrintStream out,
java.util.List<FileCompare.Result> list,
java.lang.String supress) |
(package private) boolean |
writeDir(java.io.PrintStream out,
FileCompare.Result entry) |
public static final java.lang.String version
FileCompare.Result.parent
, FileCompare.Result.setToEqual()
used if after comparison the files are copied (The.file.Commander)
static final int onlyTimestamp
static final int content
static final int withoutLineend
static final int withoutEndlineComment
static final int withoutComment
final int mode
long minDiffTimestamp
final java.lang.String[] sIgnores
public FileCompare(int mode, java.lang.String[] ignores, long minDiffTimestamp)
public void compare(FileCompare.Result result, java.lang.String[] sExclude, int recursion)
list1
- List for result for dir1list2
- list for result for dir2dir1
- A directorydir2
- The second directorysExclude
- Exclude filter for files (TODO)void compareFile(FileCompare.Result file)
file
- boolean compareFileContent(FileCompare.Result result)
file
- void reportResult(java.io.PrintStream out, java.util.List<FileCompare.Result> list, java.lang.String supress)
boolean writeDir(java.io.PrintStream out, FileCompare.Result entry)
public static void main(java.lang.String[] args)
args
- [0] and [1]: left and right directory path
[2] optional ignore on report can contain ":=zlr" prevents content equal, equal, length equal, only left, only right
[3] optional output result file, else: uses stdio.