Package org.daisy.braille.utils.pef
Class PEFFileBatchCompare
- java.lang.Object
-
- org.daisy.braille.utils.pef.PEFFileBatchCompare
-
public class PEFFileBatchCompare extends Object
Provides comparing of two folders with xml files for differences. Meta data in the files is ignored when comparing.A flat organization of files is assumed.
Warnings are generated if stray files are found (a file with the same name cannot be found in the other folder) or if the folders contain folders or files not matching the file filter.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PEFFileBatchCompare.Diff
Provides a difference specification.
-
Constructor Summary
Constructors Constructor Description PEFFileBatchCompare(FileFilter filter)
Creates a new batch comparator with the specified file filter.PEFFileBatchCompare(FileFilter filter, Supplier<InputStream> nr)
Creates a new batch comparator with the specified file filter and normalization.PEFFileBatchCompare(FileFilter filter, NormalizationResource nr)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
checkedCount()
Gets the number of pairs checked.List<PEFFileBatchCompare.Diff>
getDiffs()
Gets a list of different file pairs.List<String>
getNotices()
Gets a list of notices.List<String>
getOk()
Gets a list of matching file pairs.String
getUnbraillerTable()
Gets the identifier for the unbrailler table.List<String>
getWarnings()
Gets a list of warnings.void
run(String path1, String path2)
void
setUnbraillerTable(String unbraillerTable)
Sets the identifier for the unbrailler table.
-
-
-
Constructor Detail
-
PEFFileBatchCompare
@Deprecated public PEFFileBatchCompare(FileFilter filter, NormalizationResource nr)
Deprecated.Creates a new batch comparator with the specified file filter and normalization.- Parameters:
filter
- the filternr
- the normalization resource, an xslt
-
PEFFileBatchCompare
public PEFFileBatchCompare(FileFilter filter, Supplier<InputStream> nr)
Creates a new batch comparator with the specified file filter and normalization.- Parameters:
filter
- the filternr
- the normalization resource, an xslt
-
PEFFileBatchCompare
public PEFFileBatchCompare(FileFilter filter)
Creates a new batch comparator with the specified file filter. No normalization will be applied. To apply a normalization, usePEFFileBatchCompare(FileFilter, Supplier)
- Parameters:
filter
- the filter
-
-
Method Detail
-
getUnbraillerTable
public String getUnbraillerTable()
Gets the identifier for the unbrailler table.- Returns:
- the table identifier
-
setUnbraillerTable
public void setUnbraillerTable(String unbraillerTable)
Sets the identifier for the unbrailler table.- Parameters:
unbraillerTable
- the table
-
run
public void run(String path1, String path2) throws FileNotFoundException
- Parameters:
path1
- a folderpath2
- another folder- Throws:
FileNotFoundException
- if a path cannot be foundIllegalArgumentException
- if path is not a directory
-
getDiffs
public List<PEFFileBatchCompare.Diff> getDiffs()
Gets a list of different file pairs.- Returns:
- a list of different file pairs
-
getOk
public List<String> getOk()
Gets a list of matching file pairs.- Returns:
- a list of matching file pairs
-
checkedCount
public int checkedCount()
Gets the number of pairs checked.- Returns:
- the number of pairs checked
-
-