|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.kuka.common.ZipUtil
public final class ZipUtil
Utility class for handling zip archives.
| Method Summary | |
|---|---|
static List<String> |
compareForAddedFiles(File fileBase,
File fileComparison)
Compares two zip files in order to find added files. |
static List<String> |
compareForAddedFiles(String fileBasePath,
String fileComparisonPath)
Compares two zip files in order to find added files. |
static List<String> |
compareForDeletedFiles(File fileBase,
File fileComparison)
Compares two zip files in order to find deleted files. |
static List<String> |
compareForDeletedFiles(String fileBasePath,
String fileComparisonPath)
Compares two zip files in order to find deleted files. |
static List<String> |
compareForSameFiles(File fileBase,
File fileComparison)
Compares two zip files in order to find files that are contained in both archives. |
static void |
createZipFile(File root,
File destination)
Creates a zip file from the contents of a directory. |
static void |
enumerate(URI zipURI,
String itemId,
File destinationDir,
IFileVisitor visitor,
IProgressListener listener)
Extracts parts of or complete content of a given zip file to a given destination. |
static void |
extractAll(File zipFile,
File destinationDir)
Extracts the whole ZIP file to the specified destination directory. |
static File |
extractFile(File zipFile,
String fileToExtract,
File extractionPath,
boolean extractFullPath)
Extracts a single file from a zip archive. |
static List<String> |
getAllFilenames(File zipFile)
Query for all filenames of a given zip file. |
static List<String> |
getAllFilenames(File zipFile,
String subPath)
Gets all file names under the specified subpath. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void extractAll(File zipFile,
File destinationDir)
throws IOException
zipFile - ZIP file to extract.destinationDir - destination directory where ZIP file should be extracted to
IOException - if an I/O error has occurred
public static File extractFile(File zipFile,
String fileToExtract,
File extractionPath,
boolean extractFullPath)
throws IOException
zipFile - the zip archive containing the file.fileToExtract - the file to extract (including the path within the zip
archive).extractionPath - the destination path (must be an existing directory).extractFullPath - if true, the file is extracted with its full path within the
zip archive. Otherwise only the file is extracted to the
destination directory.
IOException - extracting file or opening zip archive fails.
public static List<String> getAllFilenames(File zipFile)
throws IOException
zipFile - file The zip file to be queried
IOException - If zip file could not be opened, an IOException is thrown
public static List<String> getAllFilenames(File zipFile,
String subPath)
throws IOException
zipFile - file The zip file to be queriedsubPath - sub path to search for files
IOException - error opening or closing the zip file.
public static void createZipFile(File root,
File destination)
throws IOException
root - The root folder of the files and directories to put in the zip
file.destination - The destination file. Will be overwritten.
IOException - Error during execution.
public static void enumerate(URI zipURI,
String itemId,
File destinationDir,
IFileVisitor visitor,
IProgressListener listener)
throws IOException
zipURI - The location of the zip file.itemId - The description of which part of the zip content should be
extracted.destinationDir - The location where the zip content should be extracted.visitor - A instance of an object which will be called if the current
item of the zip content should be extracted.listener - A listener instance (optional). Will be called for each item
that will be extracted.
IOException - If the given zip URI is invalid.
public static List<String> compareForDeletedFiles(String fileBasePath,
String fileComparisonPath)
throws IOException
fileBasePath - the base zip file which is used as the reference for the
comparisonfileComparisonPath - the zip file which is analyzed for deleted files
IOException - IO exception if the files to be compared cannot be found or
opened
public static List<String> compareForDeletedFiles(File fileBase,
File fileComparison)
throws IOException
fileBase - the base zip file which is used as the reference for the
comparisonfileComparison - the zip file which is analyzed for deleted files
IOException - IO exception if the files to be compared cannot be found or
opened
public static List<String> compareForAddedFiles(String fileBasePath,
String fileComparisonPath)
throws IOException
fileBasePath - the base zip file which is used as the reference for the
comparisonfileComparisonPath - the zip file which is analyzed for added files
IOException - IO exception if the files to be compared cannot be found or
opened
public static List<String> compareForAddedFiles(File fileBase,
File fileComparison)
throws IOException
fileBase - the base zip file which is used as the reference for the
comparisonfileComparison - the zip file which is analyzed for added files
IOException - IO exception if the files to be compared cannot be found or
opened
public static List<String> compareForSameFiles(File fileBase,
File fileComparison)
throws IOException
fileBase - the base zip file which is used as the reference for the
comparisonfileComparison - the zip file which is analyzed for same files
IOException - IO exception if the files to be compared cannot be found or
opened
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||