[prev in list] [next in list] [prev in thread] [next in thread]
List: poi-dev
Subject: [Bug 63761] New: Custom metadata properties of XLS and DOC files are not deleted.
From: bugzilla () apache ! org
Date: 2019-09-22 20:39:06
Message-ID: bug-63761-47293 () https ! bz ! apache ! org/bugzilla/
[Download RAW message or body]
https://bz.apache.org/bugzilla/show_bug.cgi?id=63761
Bug ID: 63761
Summary: Custom metadata properties of XLS and DOC files are
not deleted.
Product: POI
Version: 4.0.x-dev
Hardware: PC
Status: NEW
Severity: regression
Priority: P2
Component: HPSF
Assignee: dev@poi.apache.org
Reporter: drejcab@gmail.com
Target Milestone: ---
Created attachment 36791
--> https://bz.apache.org/bugzilla/attachment.cgi?id=36791&action=edit
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
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic