public class ArchiveUtils extends Object
Constructor and Description |
---|
ArchiveUtils() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
decompressArchiveEntry(Path archivePath,
Path internalPath)
Returns the contents of the specified entry inside an archive (ZIP or tar.gz)
as a byte array, or null if the entry is not found.
|
static void |
decompressTarGZ(Path zipFile,
Path targetDir,
JIPipeProgressInfo progressInfo) |
static void |
decompressZipFile(Path zipFile,
Path targetDir,
JIPipeProgressInfo progressInfo)
Unzips a file
|
static void |
main(String[] args) |
static void |
zipDirectory(Path rootPath,
String rootPathName,
Path zipFile,
JIPipeProgressInfo progressInfo) |
static void |
zipFileOrDirectory(Path fileToZip,
Path zipFile,
JIPipeProgressInfo progressInfo) |
public static void zipFileOrDirectory(Path fileToZip, Path zipFile, JIPipeProgressInfo progressInfo) throws IOException
IOException
public static void zipDirectory(Path rootPath, String rootPathName, Path zipFile, JIPipeProgressInfo progressInfo) throws IOException
IOException
public static void decompressZipFile(Path zipFile, Path targetDir, JIPipeProgressInfo progressInfo) throws IOException
zipFile
- the zip filetargetDir
- the target dirprogressInfo
- the progress infoIOException
- io exceptionpublic static void decompressTarGZ(Path zipFile, Path targetDir, JIPipeProgressInfo progressInfo) throws IOException
IOException
public static byte[] decompressArchiveEntry(Path archivePath, Path internalPath) throws IOException
archivePath
- the path to the archive fileinternalPath
- the path to the entry within the archiveIOException
- if there is an error reading or processing the archivepublic static void main(String[] args) throws IOException
IOException
Copyright © 2020–2025 Leibniz Institute for Natural Product Research and Infection Biology - Hans Knöll Institute (HKI). All rights reserved.