public class LoadOptions extends Object
Example usage:
final LoadOptions loadOptions = new LoadOptions();
loadOptions.setPassword("passw");
loadOptions.setFileType(FileType.PDF);
try (Comparer comparer = new Comparer(sourceFile, loadOptions)) {
comparer.add(targetFile);
comparer.compare(resultFile);
}
Comparer| Modifier and Type | Class and Description |
|---|---|
static class |
LoadOptions.Builder
A
LoadOptions builder. |
| Constructor and Description |
|---|
LoadOptions()
Initializes a new instance of the LoadOptions class.
|
LoadOptions(boolean isLoadText)
Initializes a new instance of the LoadOptions class with a flag which means that input string is a text to compare, not path.
|
LoadOptions(boolean isLoadText,
String password)
Initializes a new instance of the LoadOptions class with a flag which means that input string is a text to compare and a password to load document.
|
LoadOptions(FileType fileType)
Initializes a new instance of the LoadOptions class with a type of a file.
|
LoadOptions(String password)
Initializes a new instance of the LoadOptions class with a password to load document.
|
| Modifier and Type | Method and Description |
|---|---|
FileType |
getFileType()
Gets a type of a file that is loading.
|
List<String> |
getFontDirectories()
Gets a list of directories where font files to load a document are placed.
|
String |
getPassword()
Gets a password that will be used to load a document.
|
List<String> |
getWhitelistedResources()
Gets the resources that are still loaded while
isSkipExternalResources() is on. |
boolean |
isLoadText()
Gets a flag that indicates that the string passed to
Comparer constructor or to Comparer.add(String) method is comparison text, not file paths (For Text Comparison only). |
boolean |
isSkipExternalResources()
Gets whether loading of external resources referenced by a document is disabled.
|
void |
setFileType(FileType value)
Sets a type of a file that is loading.
|
void |
setFontDirectories(List<String> value)
Sets a list of directories where font files to load a document are placed.
|
void |
setLoadText(boolean value)
Sets a flag that indicates that the string passed to
Comparer constructor or to Comparer.add(String) method is comparison text, not file paths (For Text Comparison only). |
void |
setPassword(String value)
Sets a password that should be used to load a document.
|
void |
setSkipExternalResources(boolean value)
Sets whether loading of external resources referenced by a document is disabled.
|
void |
setWhitelistedResources(List<String> value)
Sets the resources that are still loaded while
isSkipExternalResources() is on. |
public LoadOptions()
Initializes a new instance of the LoadOptions class.
public LoadOptions(boolean isLoadText)
Initializes a new instance of the LoadOptions class with a flag which means that input string is a text to compare, not path.
isLoadText - The flag which means that input string is a text to compare, not pathpublic LoadOptions(boolean isLoadText,
String password)
Initializes a new instance of the LoadOptions class with a flag which means that input string is a text to compare and a password to load document.
isLoadText - The flag which means that input string is a text to compare, not pathpassword - The password to load documentpublic LoadOptions(FileType fileType)
Initializes a new instance of the LoadOptions class with a type of a file.
fileType - The type of the filepublic LoadOptions(String password)
Initializes a new instance of the LoadOptions class with a password to load document.
password - The password to load documentpublic FileType getFileType()
Gets a type of a file that is loading.
public List<String> getFontDirectories()
Gets a list of directories where font files to load a document are placed.
public final String getPassword()
Gets a password that will be used to load a document.
public List<String> getWhitelistedResources()
Gets the resources that are still loaded while isSkipExternalResources() is on.
public boolean isLoadText()
Gets a flag that indicates that the string passed to Comparer constructor or to Comparer.add(String) method is comparison text, not file paths (For Text Comparison only).
public boolean isSkipExternalResources()
Gets whether loading of external resources referenced by a document is disabled.
A document can point at resources outside itself, for example an image given by a remote
URL. Loading those means the comparison reaches out to whatever address the document
names, so it is off by default; getWhitelistedResources() lets named resources
through while it is on.
public void setFileType(FileType value)
Sets a type of a file that is loading.
value - The type of the filepublic void setFontDirectories(List<String> value)
Sets a list of directories where font files to load a document are placed.
value - The list of directories with font filespublic void setLoadText(boolean value)
Sets a flag that indicates that the string passed to Comparer constructor or to Comparer.add(String) method is comparison text, not file paths (For Text Comparison only).
value - true if input string is a text to compare, otherwise falsepublic final void setPassword(String value)
Sets a password that should be used to load a document.
value - The password to load the documentpublic void setSkipExternalResources(boolean value)
Sets whether loading of external resources referenced by a document is disabled.
value - true to leave external resources unloaded, false to allow thempublic void setWhitelistedResources(List<String> value)
Sets the resources that are still loaded while isSkipExternalResources() is on.
value - The URL fragments of the allowed resourcesCopyright © 2026. All rights reserved.