public class Zip
extends java.lang.Object
Constructor and Description |
---|
Zip() |
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args)
For testing
|
static java.lang.String |
unzip(java.lang.String zipFileName,
java.lang.String subDirectory)
Unzips the specified file into the specified directory
|
static java.lang.String |
zip(java.lang.String inputDirectory,
java.util.List<java.lang.String> inputFileNames,
java.lang.String fullZipFileName)
Zips up list of files into a zip file.
|
static java.lang.String |
zip(java.lang.String inputDirectory,
java.lang.String subDirectory,
java.lang.String outputFileName)
Recursively goes through directory and zips all the files into a zip
file.
|
public static java.lang.String unzip(java.lang.String zipFileName, java.lang.String subDirectory)
zipFileName
- Name of the file to be unzippedsubDirectory
- If not null then will put the resulting unzipped files into
the subdirectory. If null then resulting files end up in same
directory as the zip file.public static java.lang.String zip(java.lang.String inputDirectory, java.util.List<java.lang.String> inputFileNames, java.lang.String fullZipFileName)
inputDirectory
- Specifies directory that the inputFileNames are relative to.inputFileNames
- List of files to be put into the zip file. File names should
be relative to the inputDirectory.fullZipFileName
- The full name of the resulting zip filepublic static java.lang.String zip(java.lang.String inputDirectory, java.lang.String subDirectory, java.lang.String outputFileName)
inputDirectory
- The name of the directory where to start. This name is not
included in the file names in the zip filesubDirectory
- Appended to inputDirectory to specify what directory to be
zipped. This part of the file name is included as part of the
file names in the zip file.outputFileName
- Name of resulting zip file. The file will be put into the
directory inputDirectory + "/" subDirectory.public static void main(java.lang.String[] args)
args
-