I am having a problem with the openxml4j library in poi 3.7.

OPCPackage pkg = OPCPackage.open(filePath);
PackagePartName corePartName = 
PackagingURIHelper.createPartName("/docProps/core.xml");
PackagePart dCore = pkg.getPart(corePartName);

System.out.println(dCore.getContentType());
System.out.println(dCore.getPartName().getName());

InputStream strmCore = dCore.getInputStream();

The above code produces this exception:

org.apache.poi.openxml4j.exceptions.InvalidOperationException: Operation not 
authorized
        at 
org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart.getInputStreamImpl(PackagePropertiesPart.java:599)
        at 
org.apache.poi.openxml4j.opc.PackagePart.getInputStream(PackagePart.java:466)
        at com.test.DocTest.main(DocTest.java:42)

Line 42 is the getInputStream call.  The two sys outs show the expected values. 
 I must be missing something very obvious.

Thanks for any help.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to