Class DocumentFactoryHelper
java.lang.Object
org.docx4j.org.apache.poi.poifs.filesystem.DocumentFactoryHelper
A small base class for the various factories, e.g. WorkbookFactory,
SlideShowFactory to combine common code here.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringSome OPCPackages are packed in side an OLE2 container. -
Method Summary
Modifier and TypeMethodDescriptionstatic InputStreamgetDecryptedStream(DirectoryNode root, String password) Wrap the OLE2 data of the DirectoryNode into a decrypted stream by using the given password.static InputStreamgetDecryptedStream(POIFSFileSystem fs, String password) Wrap the OLE2 data in thePOIFSFileSysteminto a decrypted stream by using the given password.
-
Field Details
-
OOXML_PACKAGE
Some OPCPackages are packed in side an OLE2 container. If encrypted, theDirectoryNodeis called"EncryptedPackage", otherwise the node is called "Package"- See Also:
-
-
Method Details
-
getDecryptedStream
public static InputStream getDecryptedStream(POIFSFileSystem fs, String password) throws IOException Wrap the OLE2 data in thePOIFSFileSysteminto a decrypted stream by using the given password.- Parameters:
fs- The OLE2 stream for the documentpassword- The password, null if the default password should be used- Returns:
- A stream for reading the decrypted data
- Throws:
IOException- If an error occurs while decrypting or if the password does not match
-
getDecryptedStream
public static InputStream getDecryptedStream(DirectoryNode root, String password) throws IOException Wrap the OLE2 data of the DirectoryNode into a decrypted stream by using the given password.- Parameters:
root- The OLE2 directory node for the documentpassword- The password, null if the default password should be used- Returns:
- A stream for reading the decrypted data
- Throws:
IOException- If an error occurs while decrypting or if the password does not match
-