public class Compressor extends Object
Constructor and Description |
---|
Compressor() |
Modifier and Type | Method and Description |
---|---|
void |
tarGzDir(File directory,
File zipfile)
Tar.gz a directory with all its content
|
void |
zipDir(File directory,
File zipfile)
Zip a directory with all its content.
|
void |
zipFile(String filePath,
String zipFileName,
boolean deleteSourceFile)
Zip a file
|
public void zipDir(File directory, File zipfile) throws IOException
File dir = new File("/work/Test");
File dest = new File("/work/test.tar.gz");
Zipper z = new Zipper();
z.tarGzDir(dir, dest);
directory
- the File of the directoryzipfile
- the output FileIOException
- IOExceptionpublic void zipFile(String filePath, String zipFileName, boolean deleteSourceFile)
filePath
- the path of the file to zipzipFileName
- the path of the output zip filedeleteSourceFile
- if true, delete the source zipped filepublic void tarGzDir(File directory, File zipfile) throws IOException
directory
- the File of the directoryzipfile
- the output FileIOException
- IOExceptionCopyright © 2016. All rights reserved.