Package org.daisy.braille.utils.pef
Class PEFFileCompare
- java.lang.Object
-
- org.daisy.braille.utils.pef.PEFFileCompare
-
public class PEFFileCompare extends Object
Provides a file comparator for PEF.
-
-
Constructor Summary
Constructors Constructor Description PEFFileCompare()
Creates a new pef file comparator.PEFFileCompare(String path)
Creates a new comparator with the specified normalization path.PEFFileCompare(URL nr)
Creates a new comparator with the specified normalization url.PEFFileCompare(Supplier<InputStream> nr)
Creates a new comparator with the specified normalization resource.PEFFileCompare(NormalizationResource nr)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
compare(File f1, File f2)
Compares the two files.boolean
compare(StreamSource xml1, StreamSource xml2)
Compares two stream sources.int
getPos()
Gets the byte position of the first difference.
-
-
-
Constructor Detail
-
PEFFileCompare
public PEFFileCompare()
Creates a new pef file comparator.
-
PEFFileCompare
@Deprecated public PEFFileCompare(NormalizationResource nr)
Deprecated.Creates a new comparator with the specified normalization resource.- Parameters:
nr
- the normalization resource
-
PEFFileCompare
public PEFFileCompare(Supplier<InputStream> nr)
Creates a new comparator with the specified normalization resource.- Parameters:
nr
- the normalization resource
-
PEFFileCompare
public PEFFileCompare(String path)
Creates a new comparator with the specified normalization path.- Parameters:
path
- the path to the normalization resource
-
PEFFileCompare
public PEFFileCompare(URL nr)
Creates a new comparator with the specified normalization url.- Parameters:
nr
- the url to the normalization resource
-
-
Method Detail
-
compare
public boolean compare(File f1, File f2) throws PEFFileCompareException
Compares the two files.- Parameters:
f1
- the first filef2
- the second file- Returns:
- returns true if the files are equal, false otherwise
- Throws:
PEFFileCompareException
- if comparison fails
-
compare
public boolean compare(StreamSource xml1, StreamSource xml2) throws PEFFileCompareException
Compares two stream sources.- Parameters:
xml1
- the first sourcexml2
- the second source- Returns:
- returns true if the files are equal, false otherwise
- Throws:
PEFFileCompareException
- if comarison fails
-
getPos
public int getPos()
Gets the byte position of the first difference.- Returns:
- returns the position of the first failure
-
-