| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.metamatrix.core.util.ZipFileUtil
public final class ZipFileUtil
This class provides utilities to manipulate Zip files.
| Method Summary | |
|---|---|
| static boolean | add(java.io.File zipFile,
    java.lang.String fileName)Adds the file with the specified name to the specified zip file. | 
| static boolean | add(java.lang.String zipFileName,
    java.lang.String fileName)Adds the file with the specified name to the zip file with the specified name. | 
| static boolean | add(java.lang.String zipFileName,
    java.lang.String entryName,
    java.lang.String fileName)Adds the file with the specified name to the zip file with the specified name. | 
| static boolean | addAll(java.io.File zipFile,
       java.lang.String dirName)Adds all of the files in the specified directory to the specified zip file. | 
| static boolean | addAll(java.io.File zipFile,
       java.lang.String dirName,
       java.lang.String pathInZip)Adds all of the files in the specified directory to the specified zip file. | 
| static void | extract(java.lang.String zipFileName,
        java.lang.String destinationDirectory)Extract the given zip file to the given destination directory base. | 
| static java.util.List<java.lang.String> | find(java.io.File zipFile,
     java.lang.String regexExpression,
     boolean ignoreCase)Will find all entries in the jar based on the expression specified and based on if case is ignored. | 
| static java.io.InputStream | get(java.io.File zipFile,
    java.lang.String fileName,
    boolean ignoreCase)Returns the file with the specified name to the specified zip file. | 
| static java.util.jar.Manifest | getManifest(java.io.File jarfile)Attempts to obtain the manifest file from the specified file, which must be either a .jar or .zip file. | 
| static boolean | remove(java.io.File zipFile,
       java.lang.String fileName)Removes the file with the specified name to the specified zip file. | 
| static boolean | remove(java.io.File zipFile,
       java.lang.String fileName,
       boolean ignoreCase)Removes the file with the specified name to the specified zip file. | 
| static boolean | remove(java.lang.String zipFileName,
       java.lang.String fileName)Removes the file with the specified name from the zip file with the specified name. | 
| static boolean | remove(java.lang.String zipFileName,
       java.lang.String fileName,
       boolean ignoreCase)Removes the file with the specified name from the zip file with the specified name. | 
| static boolean | replace(java.io.File zipFile,
        java.lang.String replaceName,
        java.io.InputStream replaceStream) | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Method Detail | 
|---|
public static boolean add(java.lang.String zipFileName,
                          java.lang.String fileName)
                   throws java.io.IOException
zipFileName - The name of the zip file to which the file with the specified name will be added.fileName - The name of the file to be added.
java.io.IOException - If an I/O error occurs updating the zip file.
public static boolean add(java.lang.String zipFileName,
                          java.lang.String entryName,
                          java.lang.String fileName)
                   throws java.io.IOException
zipFileName - The name of the zip file to which the file with the specified name will be added.entryName - The name to call the entry in the zip file.fileName - The name of the file to be added.
java.io.IOException - If an I/O error occurs updating the zip file.
public static boolean add(java.io.File zipFile,
                          java.lang.String fileName)
                   throws java.io.IOException
zipFile - The zip file to which the file with the specified name will be added.fileName - The name of the file to be added.
java.io.IOException - If an I/O error occurs updating the zip file.
public static boolean addAll(java.io.File zipFile,
                             java.lang.String dirName)
                      throws java.io.IOException
zipFile - The zip file to which the file with the specified name will be added.dirName - The name of the directory which contains the files to be added.
java.io.IOException - If an I/O error occurs updating the zip file.
public static boolean addAll(java.io.File zipFile,
                             java.lang.String dirName,
                             java.lang.String pathInZip)
                      throws java.io.IOException
zipFile - The zip file to which the file with the specified name will be added.dirName - The name of the directory which contains the files to be added.pathInZip - Path in which the files should be added in the zip.
java.io.IOException - If an I/O error occurs updating the zip file.
public static void extract(java.lang.String zipFileName,
                           java.lang.String destinationDirectory)
                    throws java.io.IOException
zipFileName - The full path and file name of the Zip file to extract.destinationDirectory - The root directory to extract to.
java.io.IOException
public static boolean remove(java.lang.String zipFileName,
                             java.lang.String fileName,
                             boolean ignoreCase)
                      throws java.io.IOException
zipFileName - The name of the zip file from which the file with the specified name will be removed.fileName - The name of the file to be removed.ignoreCase - Indicates whether the case of the filename should be ignored when finding the match.
java.io.IOException - If an I/O error occurs updating the zip file.
public static boolean remove(java.lang.String zipFileName,
                             java.lang.String fileName)
                      throws java.io.IOException
zipFileName - The name of the zip file from which the file with the specified name will be removed.fileName - The name of the file to be removed.
java.io.IOException - If an I/O error occurs updating the zip file.
public static boolean remove(java.io.File zipFile,
                             java.lang.String fileName)
                      throws java.io.IOException
zipFile - The zip file from which the file with the specified name will be removed.fileName - The name of the file to be removed.
java.io.IOException - If an I/O error occurs updating the zip file.
public static boolean remove(java.io.File zipFile,
                             java.lang.String fileName,
                             boolean ignoreCase)
                      throws java.io.IOException
zipFile - The zip file from which the file with the specified name will be removed.fileName - The name of the file to be removed.ignoreCase - Indicates whether the case of the filename should be ignored when finding the match.
java.io.IOException - If an I/O error occurs updating the zip file.
public static boolean replace(java.io.File zipFile,
                              java.lang.String replaceName,
                              java.io.InputStream replaceStream)
                       throws java.io.IOException
java.io.IOException
public static java.io.InputStream get(java.io.File zipFile,
                                      java.lang.String fileName,
                                      boolean ignoreCase)
                               throws java.io.IOException
zipFile - The zip file from which the file with the specified name will be retrieved from.fileName - The name of the file to be returned.ignoreCase - Indicates whether the case of the filename should be ignored when finding the match.
java.io.IOException - If an I/O error occurs updating the zip file.
public static java.util.List<java.lang.String> find(java.io.File zipFile,
                                                    java.lang.String regexExpression,
                                                    boolean ignoreCase)
                                             throws java.io.IOException
zipFile - The zip file from which the find will be performed.regexExpression - The regex expression supported by java.util.regexignoreCase - Indicates whether the case of an entry in the jar file should be ignored when finding the match.
java.io.IOException - If an I/O error occurs reading the zip file.public static java.util.jar.Manifest getManifest(java.io.File jarfile)
path - VENDOR - 
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||