public class TarUtils
extends java.lang.Object
| Constructor and Description |
|---|
TarUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addFolderContent(org.apache.commons.compress.archivers.ArchiveOutputStream tarOutput,
java.io.File folder,
WaitingHandler waitingHandler)
Add content to the tar file.
|
static void |
extractFile(java.io.File tarFile,
WaitingHandler waitingHandler)
Extracts files from a tar.
|
static void |
tarFolder(java.io.File folder,
java.io.File destinationFile,
WaitingHandler waitingHandler)
Tar a given folder in a file.
|
public static void tarFolder(java.io.File folder,
java.io.File destinationFile,
WaitingHandler waitingHandler)
throws java.io.FileNotFoundException,
org.apache.commons.compress.archivers.ArchiveException,
java.io.IOException
folder - the original folder to tardestinationFile - the destination filewaitingHandler - a waiting handler used to cancel the process (can
be null)java.io.FileNotFoundException - exception thrown whenever a file is not
foundorg.apache.commons.compress.archivers.ArchiveException - exception thrown whenever an error occurred
while taringjava.io.IOException - exception thrown whenever an error occurred while
reading/writing filespublic static void addFolderContent(org.apache.commons.compress.archivers.ArchiveOutputStream tarOutput,
java.io.File folder,
WaitingHandler waitingHandler)
throws java.io.FileNotFoundException,
java.io.IOException
tarOutput - the archive output streamfolder - the folder to addwaitingHandler - a waiting handler used to cancel the process (can
be null)java.io.FileNotFoundException - exception thrown whenever a file is not
foundjava.io.IOException - exception thrown whenever an error occurred while
reading/writing filespublic static void extractFile(java.io.File tarFile,
WaitingHandler waitingHandler)
throws java.io.FileNotFoundException,
org.apache.commons.compress.archivers.ArchiveException,
java.io.IOException
tarFile - the tar filewaitingHandler - a waiting handler displaying progress and allowing
canceling the processjava.io.FileNotFoundExceptionorg.apache.commons.compress.archivers.ArchiveExceptionjava.io.IOExceptionCopyright © 2014. All Rights Reserved.