@Internal public final class ZipHelper extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static org.apache.commons.compress.archivers.zip.ZipArchiveEntry |
getCorePropertiesZipEntry(ZipPackage pkg)
Retrieve the zip entry of the core properties part.
(检索核心属性部分的 zip 条目。)
|
static java.lang.String |
getOPCNameFromZipItemName(java.lang.String zipItemName)
Convert a zip name into an OPC name by adding a leading forward slash to the specified item name.
(通过将前导正斜杠添加到指定的项目名称,将 zip 名称转换为 OPC 名称。)
|
static java.lang.String |
getZipItemNameFromOPCName(java.lang.String opcItemName)
Convert an OPC item name into a zip item name by removing any leading forward slash if it exist.
(通过删除任何前导正斜杠(如果存在)将 OPC 项目名称转换为 zip 项目名称。)
|
static java.net.URI |
getZipURIFromOPCName(java.lang.String opcItemName)
Convert an OPC item name into a zip URI by removing any leading forward slash if it exist.
(通过删除任何前导正斜杠(如果存在)将 OPC 项目名称转换为 zip URI。)
|
static ZipSecureFile |
openZipFile(java.io.File file)
Opens the specified file as a secure zip, or returns null if no such file exists
(以安全 zip 格式打开指定文件,如果不存在此类文件,则返回 null)
|
static ZipSecureFile |
openZipFile(java.lang.String path)
Retrieve and open as a secure zip file with the specified path.
(检索并作为具有指定路径的安全 zip 文件打开。)
|
static ZipArchiveThresholdInputStream |
openZipStream(java.io.InputStream stream)
Opens the specified stream as a secure zip
(以安全 zip 格式打开指定的流)
|
public static org.apache.commons.compress.archivers.zip.ZipArchiveEntry getCorePropertiesZipEntry(ZipPackage pkg)
java.lang.IllegalArgumentException
- If the relationship for core properties cannot be read or an invalid name is specified in the properties.
(java.lang.IllegalArgumentException - 如果无法读取核心属性的关系或在属性中指定了无效名称。)
public static java.lang.String getOPCNameFromZipItemName(java.lang.String zipItemName)
zipItemName
- Zip item name to convert.
(zipItemName - 要转换的 Zip 项目名称。)
public static java.lang.String getZipItemNameFromOPCName(java.lang.String opcItemName)
opcItemName
- The OPC item name to convert.
(opcItemName - 要转换的 OPC 项目名称。)
public static java.net.URI getZipURIFromOPCName(java.lang.String opcItemName)
opcItemName
- The OPC item name to convert.
(opcItemName - 要转换的 OPC 项目名称。)
public static ZipArchiveThresholdInputStream openZipStream(java.io.InputStream stream) throws java.io.IOException
stream
- The stream to open.
(stream - 要打开的流。)
java.io.IOException
(java.io.IOException)
public static ZipSecureFile openZipFile(java.io.File file) throws java.io.IOException, NotOfficeXmlFileException
file
- The file to open.
(file - 要打开的文件。)
java.io.IOException
- if the zip file cannot be opened or closed to read the header signature
(java.io.IOException - 如果 zip 文件无法打开或关闭以读取标头签名)
NotOfficeXmlFileException
- if stream does not start with zip header signature
(NotOfficeXmlFileException - 如果流不以 zip 标头签名开头)
public static ZipSecureFile openZipFile(java.lang.String path) throws java.io.IOException
path
- The file path.
(path - 文件路径。)
java.io.IOException
(java.io.IOException)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.