Summary: | Custom metadata properties of XLS and DOC files are not deleted. | ||
---|---|---|---|
Product: | POI | Reporter: | drejcab |
Component: | HPSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | regression | ||
Priority: | P2 | ||
Version: | 4.0.x-dev | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All | ||
Attachments: | Office 97 file with custom properties |
Does DocumentSummaryInformation.removeCustomProperties() work for your usecase? (In reply to Andreas Beeker from comment #1) > Does DocumentSummaryInformation.removeCustomProperties() work for your > usecase? ok, DocumentSummaryInformation.removeCustomProperties () works correctly. Regards, |
Created attachment 36791 [details] Office 97 file with custom properties For Office 97 files, it allows you to add custom properties but does not allow you to delete all custom properties. Attached code to remove all custom properties: InputStream is = new FileInputStream(new File("C:\test\CustomProperties.doc")); POIFSFileSystem poifs = new POIFSFileSystem(is); is.close(); DirectoryEntry dir = poifs.getRoot(); HPSFPropertiesOnlyDocument dis = new HPSFPropertiesOnlyDocument(poifs); DocumentSummaryInformation dsi = dis.getDocumentSummaryInformation(); //Remove all Custom Properties dsi.setCustomProperties(new CustomProperties()); dsi.write(dir, DocumentSummaryInformation.DEFAULT_STREAM_NAME); si.write(dir, SummaryInformation.DEFAULT_STREAM_NAME); OutputStream out = new FileOutputStream("C:\test\CustomProperties_2.doc"); poifs.writeFilesystem(out); out.close(); In version 3.15 it worked correctly. I need this functionality before moving on to version 4.10