Package com.deltawalker.script
Interface FileComparison
- All Superinterfaces:
Comparison,HistoryEntry
- All Known Subinterfaces:
ImageComparison,TextComparison
A
Comparison of individual files - text or images. Adds the ability
to save the files of the comparison, for example after a merge.
const MergeOp = Java.type('com.deltawalker.script.MergeOp');
const Role = Java.type('com.deltawalker.script.Role');
// A three-way text comparison
await comp.compare();
await comp.merge(MergeOp.MERGE, comp.getAllDeltas(), null, Role.REF, null);
comp.save(Role.REF, App.getProperty('user.home') + '/test/merged.txt', null);
- Since:
- 2.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.deltawalker.script.Comparison
Comparison.Method, Comparison.State, Comparison.Type -
Method Summary
Modifier and TypeMethodDescriptionvoidsave(Role role, String path, ProgressListener pm) Saves the file with the specifiedRole.voidSaves all files of this comparison to their current locations.voidsaveEx(Role role, UriInfo uriInfo, ProgressListener pl) Methods inherited from interface com.deltawalker.script.Comparison
addListener, close, compare, hasDifferences, isClosed, print, removeListenerMethods inherited from interface com.deltawalker.script.HistoryEntry
getCreationTime, getDisplayCreationTime, getName, getPaths, getRoles, getSettings, getType, getUriInfos, setName
-
Method Details
-
save
Saves the file with the specifiedRole.- Parameters:
role- theRoleof the file to save; cannot benulland must be a role of this comparison, for instanceRole.TWOis not a role of a two-way comparisonpath- the path to save the file to. Whennullor an empty string, the file is saved to its current location.pm- reserved; passnull- Throws:
IOException- if the save operation failsNullPointerException- ifroleisnullIllegalArgumentException- ifpathisnullor empty and the file has no current location- Since:
- 2.0
-
saveAll
Saves all files of this comparison to their current locations.- Parameters:
pm- reserved; passnull- Throws:
IOException- if the save operation fails- Since:
- 2.0
-
saveEx
Saves the file with the specifiedRoleto the location described by the specifiedUriInfo, for example to a remote server or with a specific character encoding.- Parameters:
role- theRoleof the file to save; cannot benulland must be a role of this comparisonuriInfo- where and how to save the file. Whennullor when its URI is empty, the file is saved to its current location.pl- reserved; passnull- Throws:
IOException- if the save operation failsNullPointerException- ifroleisnullIllegalArgumentException- ifuriInfoisnullor empty and the file has no current location- Since:
- 2.0
-