org.apache.poi.openxml4j.opc.internal
Class ZipHelper
- java.lang.Object
-
- org.apache.poi.openxml4j.opc.internal.ZipHelper
-
public final class ZipHelper extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field and Description static intREAD_WRITE_FILE_BUFFER_SIZEBuffer to read data from file.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static java.util.zip.ZipEntrygetContentTypeZipEntry(ZipPackage pkg)Retrieve the Zip entry of the content types part.static java.util.zip.ZipEntrygetCorePropertiesZipEntry(ZipPackage pkg)Retrieve the zip entry of the core properties part.static java.lang.StringgetOPCNameFromZipItemName(java.lang.String zipItemName)Convert a zip name into an OPC name by adding a leading forward slash to the specified item name.static java.lang.StringgetZipItemNameFromOPCName(java.lang.String opcItemName)Convert an OPC item name into a zip item name by removing any leading forward slash if it exist.static java.net.URIgetZipURIFromOPCName(java.lang.String opcItemName)Convert an OPC item name into a zip URI by removing any leading forward slash if it exist.static java.util.zip.ZipFileopenZipFile(java.io.File file)Opens the specified file as a zip, or returns null if no such file existsstatic java.util.zip.ZipFileopenZipFile(java.lang.String path)Retrieve and open a zip file with the specified path.
-
-
-
Field Detail
-
READ_WRITE_FILE_BUFFER_SIZE
public static final int READ_WRITE_FILE_BUFFER_SIZE
Buffer to read data from file. Use big buffer to improve performaces. the InputStream class is reading only 8192 bytes per read call (default value set by sun)- See Also:
- Constant Field Values
-
-
Method Detail
-
getCorePropertiesZipEntry
public static java.util.zip.ZipEntry getCorePropertiesZipEntry(ZipPackage pkg)
Retrieve the zip entry of the core properties part.- Throws:
OpenXML4JException- Throws if internal error occurs.
-
getContentTypeZipEntry
public static java.util.zip.ZipEntry getContentTypeZipEntry(ZipPackage pkg)
Retrieve the Zip entry of the content types part.
-
getOPCNameFromZipItemName
public 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.- Parameters:
zipItemName- Zip item name to convert.- Returns:
- An OPC compliant name.
-
getZipItemNameFromOPCName
public 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.- Parameters:
opcItemName- The OPC item name to convert.- Returns:
- A zip item name without any leading slashes.
-
getZipURIFromOPCName
public 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.- Parameters:
opcItemName- The OPC item name to convert.- Returns:
- A zip URI without any leading slashes.
-
openZipFile
public static java.util.zip.ZipFile openZipFile(java.io.File file) throws java.io.IOExceptionOpens the specified file as a zip, or returns null if no such file exists- Parameters:
file- The file to open.- Returns:
- The zip archive freshly open.
- Throws:
java.io.IOException
-
openZipFile
public static java.util.zip.ZipFile openZipFile(java.lang.String path) throws java.io.IOExceptionRetrieve and open a zip file with the specified path.- Parameters:
path- The file path.- Returns:
- The zip archive freshly open.
- Throws:
java.io.IOException
-
-
DataMelt 3.0 © DataMelt by jWork.ORG