com.compomics.util.io
Class TarUtils

java.lang.Object
  extended by com.compomics.util.io.TarUtils

public class TarUtils
extends java.lang.Object

This class contains convenience methods for taring files.

Author:
Marc Vaudel

Constructor Summary
TarUtils()
           
 
Method Summary
static void addFolderContent(org.apache.commons.compress.archivers.ArchiveOutputStream tarOutput, java.io.File folder, WaitingHandler waitingHandler)
          Add content to the tar file.
static void tarFolder(java.io.File folder, java.io.File destinationFile, WaitingHandler waitingHandler)
          Tar a given folder in a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TarUtils

public TarUtils()
Method Detail

tarFolder

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
Tar a given folder in a file.

Parameters:
folder - the original folder to tar
destinationFile - the destination file
waitingHandler - a waiting handler used to cancel the process (can be null)
Throws:
java.io.FileNotFoundException - exception thrown whenever a file is not found
org.apache.commons.compress.archivers.ArchiveException - exception thrown whenever an error occurred while taring
java.io.IOException - exception thrown whenever an error occurred while reading/writing files

addFolderContent

public static void addFolderContent(org.apache.commons.compress.archivers.ArchiveOutputStream tarOutput,
                                    java.io.File folder,
                                    WaitingHandler waitingHandler)
                             throws java.io.FileNotFoundException,
                                    java.io.IOException
Add content to the tar file.

Parameters:
tarOutput - the archive output stream
folder - the folder to add
waitingHandler - a waiting handler used to cancel the process (can be null)
Throws:
java.io.FileNotFoundException - exception thrown whenever a file is not found
java.io.IOException - exception thrown whenever an error occurred while reading/writing files


Copyright © 2013. All Rights Reserved.