public class ArchiveUtils extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
ArchiveUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
tarGzExtractSingleFile(File tarGz,
File destination,
String pathInTarGz)
Extract a single file from a tar.gz file.
|
static List<String> |
tarGzListFiles(File tarGzFile)
List all of the files and directories in the specified tar.gz file
|
static void |
unzipFileTo(String file,
String dest)
Extracts files to the specified destination
|
static void |
zipExtractSingleFile(File zipFile,
File destination,
String pathInZip)
Extract a single file from a .zip file.
|
static List<String> |
zipListFiles(File zipFile)
List all of the files and directories in the specified .zip file
|
public static void unzipFileTo(String file, String dest) throws IOException
file - the file to extract todest - the destination directoryIOExceptionpublic static List<String> tarGzListFiles(File tarGzFile) throws IOException
tarGzFile - A tar.gz fileIOExceptionpublic static List<String> zipListFiles(File zipFile) throws IOException
zipFile - Zip fileIOExceptionpublic static void zipExtractSingleFile(File zipFile, File destination, String pathInZip) throws IOException
zipFile - Zip file to extract fromdestination - Destination filepathInZip - Path in the zip to extractIOException - If exception occurs while reading/writingpublic static void tarGzExtractSingleFile(File tarGz, File destination, String pathInTarGz) throws IOException
unzipFileTo(String, String) for batch extraction insteadtarGz - A tar.gz filedestination - The destination file to extract topathInTarGz - The path in the tar.gz file to extractIOExceptionCopyright © 2019. All rights reserved.