public class Decompressor extends Object
Constructor and Description |
---|
Decompressor() |
Modifier and Type | Method and Description |
---|---|
ArrayList<String> |
getZipContent(String zipName)
List zip content
|
static void |
main(String[] args) |
boolean |
untarDirWithManyFiles(String dirPath,
String destPath,
boolean flatAllContent)
Untar all tar.gz files in the given directory.
|
void |
untarFile(File tarFile,
File dest,
boolean flatAllContent)
Uncompress a tar.gz file
|
void |
untarFile(String tarFullPathName,
String outputDirName,
boolean flatAllContent)
Uncompress a tar.gz file.
|
boolean |
unzipDirWithManyFiles(String dirPath,
boolean createNewDir)
Unzip all zip files in a given directory.
|
String |
unzipFile(String zipFullPathName,
String outputDirName)
Unzip a zip file, with all its subdirectories and content files
|
public ArrayList<String> getZipContent(String zipName)
zipName
- the fullpath of the zip filepublic String unzipFile(String zipFullPathName, String outputDirName)
zipFullPathName
- the fullpath of the zip file to be extractedoutputDirName
- the name of the directory containing the output, use null or empty string to extract at the same level of the zippublic boolean unzipDirWithManyFiles(String dirPath, boolean createNewDir)
dirPath
- the given directory, containing zip filescreateNewDir
- true to create a directory for each Zip file to extractpublic void untarFile(String tarFullPathName, String outputDirName, boolean flatAllContent)
tarFullPathName
- the fullpath to the source tar.gz fileoutputDirName
- the destination directoryflatAllContent
- if true, all extracted files will be in the same directory, flatting the original structurepublic void untarFile(File tarFile, File dest, boolean flatAllContent)
tarFile
- the File to untardest
- the File of destination directoryflatAllContent
- if true, all extracted files will be in the same directory, flatting the original structurepublic boolean untarDirWithManyFiles(String dirPath, String destPath, boolean flatAllContent)
dirPath
- the given directory, containing tar.gz filesdestPath
- the output directoryflatAllContent
- if true, all extracted files will be in the same directory, flatting the original structurepublic static void main(String[] args)
Copyright © 2016. All rights reserved.