public final class ZipHelper extends Object
Modifier and Type | Field and Description |
---|---|
static int |
READ_WRITE_FILE_BUFFER_SIZE
Buffer to read data from file.
|
Modifier and Type | Method and Description |
---|---|
static ZipEntry |
getContentTypeZipEntry(ZipPackage pkg)
Retrieve the Zip entry of the content types part.
|
static ZipEntry |
getCorePropertiesZipEntry(ZipPackage pkg)
Retrieve the zip entry of the core properties part.
|
static String |
getOPCNameFromZipItemName(String zipItemName)
Convert a zip name into an OPC name by adding a leading forward slash to
the specified item name.
|
static String |
getZipItemNameFromOPCName(String opcItemName)
Convert an OPC item name into a zip item name by removing any leading
forward slash if it exist.
|
static URI |
getZipURIFromOPCName(String opcItemName)
Convert an OPC item name into a zip URI by removing any leading forward
slash if it exist.
|
static ZipFile |
openZipFile(File file)
Opens the specified file as a zip, or returns null if no such file exists
|
static ZipFile |
openZipFile(String path)
Retrieve and open a zip file with the specified path.
|
public static final int READ_WRITE_FILE_BUFFER_SIZE
public static ZipEntry getCorePropertiesZipEntry(ZipPackage pkg)
OpenXML4JException
- Throws if internal error occurs.public static ZipEntry getContentTypeZipEntry(ZipPackage pkg)
public static String getOPCNameFromZipItemName(String zipItemName)
zipItemName
- Zip item name to convert.public static String getZipItemNameFromOPCName(String opcItemName)
opcItemName
- The OPC item name to convert.public static URI getZipURIFromOPCName(String opcItemName)
opcItemName
- The OPC item name to convert.public static ZipFile openZipFile(File file) throws IOException
file
- The file to open.IOException
public static ZipFile openZipFile(String path) throws IOException
path
- The file path.IOException
Copyright © 2020. All rights reserved.