|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ourgrid.common.util.SimpleZip
public class SimpleZip
This class is supposed to zip files into a .zip file and extract them without creating parent directories. Algorithms used here are based on the ones at http://www.javalobby.org/java/forums/t16299.html
Constructor Summary | |
---|---|
SimpleZip()
|
Method Summary | |
---|---|
static void |
main(java.lang.String[] args)
Main |
static void |
unzipIt(java.io.File file,
java.lang.String destinationDirectory)
Unzips without creating parent directories. |
static void |
zipIt(java.lang.String[] filesToZip,
java.lang.String zipFileName)
Zips files. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleZip()
Method Detail |
---|
public static void zipIt(java.lang.String[] filesToZip, java.lang.String zipFileName) throws java.io.IOException
filesToZip
- Filepaths to zip.zipFileName
- The zip file path with respective name.
java.io.IOException
- Thrown if an IO exception occurs while zipping files.public static void unzipIt(java.io.File file, java.lang.String destinationDirectory) throws java.io.IOException
file
- The zip file to be extracted.destinationDirectory
- The destination directory where extracted
files will be placed.
java.io.IOException
- Thrown if an IO exception occurs while unzipping
files.public static void main(java.lang.String[] args)
args
- The first parameter is either "-c" or "-x" (to compress or
extract, respectively). If "-c", the second parameter is the zip
file path, and the others are file paths to compress (separated by
space). If "-x", the second parameter is the zip file path to
unzip, and the other is the destination directory where the will
be placed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |