public class TarUtils extends Object
| Constructor and Description |
|---|
TarUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addFolderContent(org.apache.commons.compress.archivers.ArchiveOutputStream tarOutput,
File folder,
WaitingHandler waitingHandler)
Add content to the tar file.
|
static void |
extractFile(File tarFile,
File destinationFolder,
String backwardCompatibilityCorrection,
WaitingHandler waitingHandler)
Extracts files from a tar.
|
static void |
extractFile(File tarFile,
File destinationFolder,
WaitingHandler waitingHandler)
Extracts files from a tar.
|
static void |
extractFile(File tarFile,
WaitingHandler waitingHandler)
Extracts files from a tar.
|
static void |
tarFolder(File folder,
File destinationFile,
WaitingHandler waitingHandler)
Tar a given folder in a file.
|
public static void tarFolder(File folder, File destinationFile, WaitingHandler waitingHandler) throws FileNotFoundException, org.apache.commons.compress.archivers.ArchiveException, IOException
folder - the original folder to tardestinationFile - the destination filewaitingHandler - a waiting handler used to cancel the process (can
be null)FileNotFoundException - exception thrown whenever a file is not
foundorg.apache.commons.compress.archivers.ArchiveException - exception thrown whenever an error occurred
while taringIOException - exception thrown whenever an error occurred while
reading/writing filespublic static void addFolderContent(org.apache.commons.compress.archivers.ArchiveOutputStream tarOutput,
File folder,
WaitingHandler waitingHandler)
throws FileNotFoundException,
IOException
tarOutput - the archive output streamfolder - the folder to addwaitingHandler - a waiting handler used to cancel the process (can
be null)FileNotFoundException - exception thrown whenever a file is not
foundIOException - exception thrown whenever an error occurred while
reading/writing filespublic static void extractFile(File tarFile, WaitingHandler waitingHandler) throws FileNotFoundException, org.apache.commons.compress.archivers.ArchiveException, IOException
tarFile - the tar filewaitingHandler - a waiting handler displaying progress and allowing
canceling the processFileNotFoundExceptionorg.apache.commons.compress.archivers.ArchiveExceptionIOExceptionpublic static void extractFile(File tarFile, File destinationFolder, WaitingHandler waitingHandler) throws FileNotFoundException, org.apache.commons.compress.archivers.ArchiveException, IOException
tarFile - the tar filedestinationFolder - the destination folder, if null the file will be
extracted according to the archive namewaitingHandler - a waiting handler displaying progress and allowing
canceling the processFileNotFoundExceptionorg.apache.commons.compress.archivers.ArchiveExceptionIOExceptionpublic static void extractFile(File tarFile, File destinationFolder, String backwardCompatibilityCorrection, WaitingHandler waitingHandler) throws FileNotFoundException, org.apache.commons.compress.archivers.ArchiveException, IOException
tarFile - the tar filedestinationFolder - the destination folder, if null the file will be
extracted according to the archive namebackwardCompatibilityCorrection - prefix to subtract to entry names
for backward compatibility, ignored if nullwaitingHandler - a waiting handler displaying progress and allowing
canceling the processFileNotFoundExceptionorg.apache.commons.compress.archivers.ArchiveExceptionIOExceptionCopyright © 2014. All rights reserved.