org.apache.poi.openxml4j.opc.internal
Class ZipHelper

java.lang.Object
  extended by org.apache.poi.openxml4j.opc.internal.ZipHelper

public final class ZipHelper
extends java.lang.Object


Field Summary
static int READ_WRITE_FILE_BUFFER_SIZE
          Buffer to read data from file.
 
Method Summary
static java.util.zip.ZipEntry getContentTypeZipEntry(ZipPackage pkg)
          Retrieve the Zip entry of the content types part.
static java.util.zip.ZipEntry getCorePropertiesZipEntry(ZipPackage pkg)
          Retrieve the zip entry of the core properties part.
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.
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.
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.
static java.util.zip.ZipFile openZipFile(java.lang.String path)
          Retrieve and open a zip file with the specified path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.lang.String path)
Retrieve and open a zip file with the specified path.

Parameters:
path - The file path.
Returns:
The zip archive freshly open.


Copyright 2012 The Apache Software Foundation or its licensors, as applicable.