public final class TarGzipPacker
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.logging.Logger |
LOG |
Modifier and Type | Method and Description |
---|---|
boolean |
addDirectoryToArchive(java.lang.String path)
add all files in the given directory to the tar.gz file
add the given prefix to all files in tar names
do not copy files recursively.
|
boolean |
addFileToArchive(java.io.File file,
java.lang.String dirPrefixForTar)
add one file to tar.gz file
|
boolean |
addFileToArchive(java.lang.String filename)
add one file to tar.gz file
|
boolean |
addFileToArchive(java.lang.String filename,
byte[] contents)
add one file to tar.gz file
file is created from the given byte array
|
boolean |
addTarGzipToArchive(java.lang.String tarGzipFile)
given tar.gz file will be copied to this tar.gz file.
|
boolean |
addZipToArchive(java.lang.String zipFile)
given tar.gz file will be copied to this tar.gz file.
|
boolean |
addZipToArchive(java.lang.String zipFile,
java.lang.String dirPrefixForTar)
given tar.gz file will be copied to this tar.gz file.
|
void |
close()
close the tar stream
|
static TarGzipPacker |
createTarGzipPacker(java.lang.String targetDir,
Config config)
create TarGzipPacker object
|
java.lang.String |
getArchiveFileName()
Get name
|
static boolean |
unpack(java.nio.file.Path sourceGzip,
java.nio.file.Path outputDir)
unpackage the given tar.gz file to the provided output directory
|
static boolean |
unpack(java.lang.String sourceGzip)
unpack the received job package
job package needs to be a tar.gz package
it unpacks to the directory where the job package resides
|
public static TarGzipPacker createTarGzipPacker(java.lang.String targetDir, Config config)
public java.lang.String getArchiveFileName()
public boolean addTarGzipToArchive(java.lang.String tarGzipFile)
tarGzipFile
- the archive file to be copied to the new archivepublic boolean addZipToArchive(java.lang.String zipFile)
zipFile
- the archive file to be copied to the new archivepublic boolean addZipToArchive(java.lang.String zipFile, java.lang.String dirPrefixForTar)
zipFile
- the archive file to be copied to the new archivedirPrefixForTar
- sub path inside the archivepublic boolean addFileToArchive(java.lang.String filename)
filename
- full path of the file name to be added to the jarpublic boolean addFileToArchive(java.io.File file, java.lang.String dirPrefixForTar)
file
- file to be added to the tar.gzpublic boolean addDirectoryToArchive(java.lang.String path)
path
- of the firectory to be addedpublic boolean addFileToArchive(java.lang.String filename, byte[] contents)
filename
- file to be added to the tar.gzpublic void close()
public static boolean unpack(java.lang.String sourceGzip)
public static boolean unpack(java.nio.file.Path sourceGzip, java.nio.file.Path outputDir)