revert();
return;
}
+ if (this.contentTypeManager == null) {
+ logger.log(POILogger.WARN,
+ "Unable to call close() on a package that hasn't been fully opened yet");
+ return;
+ }
// Save the content
ReentrantReadWriteLock l = new ReentrantReadWriteLock();
public ZipPackage() {
super(defaultPackageAccess);
this.zipArchive = null;
+
+ try {
+ this.contentTypeManager = new ZipContentTypeManager(null, this);
+ } catch (InvalidFormatException e) {}
}
/**
public static void main(String[] args) throws Exception {
if(args.length < 1) {
System.err.println("Use:");
- System.err.println(" HXFWordExtractor <filename.docx>");
+ System.err.println(" XWPFWordExtractor <filename.docx>");
System.exit(1);
}
POIXMLTextExtractor extractor =
args[0]
));
System.out.println(extractor.getText());
+ extractor.close();
}
public String getText() {