public final class CopyCompare extends Object
Property set streams are copied logically, i.e. the application
establishes a PropertySet of an original property
set, creates a PropertySet and writes the
PropertySet to the destination POI file
system. - Streams which are no property set streams are copied bit by
bit.
The comparison of the POI file systems is done logically. That means that the two disk files containing the POI file systems do not need to be exactly identical. However, both POI file systems must contain the same files, and most of these files must be bitwise identical. Property set streams, however, are compared logically: they must have the same sections with the same attributes, and the sections must contain the same properties. Details like the ordering of the properties do not matter.
| Modifier and Type | Method and Description |
|---|---|
static boolean |
compare(String originalFileName,
String copyFileName) |
static void |
handleEvent(POIFSFileSystem poiFs,
POIFSReaderEvent event)
The method is called by POI's eventing API for each file in the origin POIFS.
|
static void |
main(String[] args)
Runs the example program.
|
public static void main(String[] args) throws IOException
args - Command-line arguments.IOException - if any I/O exception occurs.UnsupportedEncodingException - if a character encoding is not
supported.public static boolean compare(String originalFileName, String copyFileName) throws IOException
IOExceptionpublic static void handleEvent(POIFSFileSystem poiFs, POIFSReaderEvent event)