@Internal public final class DocumentFactoryHelper extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.io.InputStream |
getDecryptedStream(DirectoryNode root, java.lang.String password)
Wrap the OLE2 data of the DirectoryNode into a decrypted stream by using the given password.
(使用给定的密码将 DirectoryNode 的 OLE2 数据包装成解密的流。)
|
static java.io.InputStream |
getDecryptedStream(POIFSFileSystem fs, java.lang.String password)
Wrap the OLE2 data in the
POIFSFileSystem into a decrypted stream by using the given password.
(使用给定的密码将 POIFSFileSystem 中的 OLE2 数据包装成解密的流。)
|
static boolean |
hasOOXMLHeader(java.io.InputStream inp)
Deprecated.
in 3.17-beta2, use
(已弃用。在 3.17-beta2 中,请改用 FileMagic.valueOf(InputStream) == FileMagic.OOXML)
FileMagic.valueOf(InputStream) == FileMagic.OOXML instead
|
public static java.io.InputStream getDecryptedStream(POIFSFileSystem fs, java.lang.String password) throws java.io.IOException
POIFSFileSystem
into a decrypted stream by using the given password.
(使用给定的密码将 POIFSFileSystem 中的 OLE2 数据包装成解密的流。)
fs
- The OLE2 stream for the document
(fs - 文档的 OLE2 流)
password
- The password, null if the default password should be used
(password - 密码,如果应该使用默认密码,则为 null)
java.io.IOException
- If an error occurs while decrypting or if the password does not match
(java.io.IOException - 如果解密时发生错误或密码不匹配)
public static java.io.InputStream getDecryptedStream(DirectoryNode root, java.lang.String password) throws java.io.IOException
root
- The OLE2 directory node for the document
(root - 文档的 OLE2 目录节点)
password
- The password, null if the default password should be used
(password - 密码,如果应该使用默认密码,则为 null)
java.io.IOException
- If an error occurs while decrypting or if the password does not match
(java.io.IOException - 如果解密时发生错误或密码不匹配)
@Deprecated @Removal(version="4.0") public static boolean hasOOXMLHeader(java.io.InputStream inp) throws java.io.IOException
FileMagic.valueOf(InputStream)
== FileMagic.OOXML instead
If unsure if your InputStream does support mark / reset, use FileMagic.prepareToCheckMagic(InputStream)
to wrap it and make sure to always use that, and not the original!
inp
- An InputStream which supports either mark/reset
(inp - 支持标记/重置的 InputStream)
java.io.IOException
(java.io.IOException)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.