uk.org.retep.util.io.tar
Class TarUtils

java.lang.Object
  extended by uk.org.retep.util.io.tar.TarUtils

public class TarUtils
extends java.lang.Object

A collection of utility methods for handling tar archives

Author:
peter

Method Summary
static void createTar(java.io.File tarFile, java.io.File baseDirectory, java.io.FileFilter filter, boolean recurse)
          Create a tar file based on a list of files.
static void createTar(java.io.File tarFile, java.io.File baseDirectory, java.util.List<java.io.File> files)
          Create a tar file based on a list of files.
static void createTar(java.io.File tarFile, java.util.List<java.io.File> files)
          Create a tar file based on a list of files.
static void createTar(Log log, java.io.File tarFile, java.io.File baseDirectory, java.io.FileFilter filter, boolean recurse)
          Create a tar file based on a list of files.
static void createTar(Log log, java.io.File tarFile, java.io.File baseDirectory, java.util.List<java.io.File> files)
          Create a tar file based on a list of files.
static void createTar(Log log, java.io.File tarFile, java.util.List<java.io.File> files)
          Create a tar file based on a list of files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createTar

public static void createTar(java.io.File tarFile,
                             java.util.List<java.io.File> files)
                      throws java.io.IOException
Create a tar file based on a list of files.

If the destination filename ends with .tar.gz or .tgz then the file will be compressed with GZip.

If the destination filename ends with ".tar.bz2" then the file will be compressed with BZip2.

Parameters:
tarFile - Destination File
files - List of files to include in the Tar archive
Throws:
java.io.IOException - on error

createTar

public static void createTar(java.io.File tarFile,
                             java.io.File baseDirectory,
                             java.io.FileFilter filter,
                             boolean recurse)
                      throws java.io.IOException
Create a tar file based on a list of files.

If the destination filename ends with .tar.gz or .tgz then the file will be compressed with GZip.

If the destination filename ends with ".tar.bz2" then the file will be compressed with BZip2.

Parameters:
tarFile - Destination File
baseDirectory - File denoting the source base directory.
filter - FileFilter to choose what files will be included
recurse - true if to recurse down directories
Throws:
java.io.IOException - on error

createTar

public static void createTar(java.io.File tarFile,
                             java.io.File baseDirectory,
                             java.util.List<java.io.File> files)
                      throws java.io.IOException
Create a tar file based on a list of files.

If the destination filename ends with .tar.gz or .tgz then the file will be compressed with GZip.

If the destination filename ends with ".tar.bz2" then the file will be compressed with BZip2.

Parameters:
tarFile - Destination File
baseDirectory - File denoting the source base directory.
files - List of files to include in the Tar archive
Throws:
java.io.IOException - on error

createTar

public static void createTar(Log log,
                             java.io.File tarFile,
                             java.util.List<java.io.File> files)
                      throws java.io.IOException
Create a tar file based on a list of files.

If the destination filename ends with .tar.gz or .tgz then the file will be compressed with GZip.

If the destination filename ends with ".tar.bz2" then the file will be compressed with BZip2.

Parameters:
log - Log to log progress to, may be null
tarFile - Destination File
files - List of files to include in the Tar archive
Throws:
java.io.IOException - on error

createTar

public static void createTar(Log log,
                             java.io.File tarFile,
                             java.io.File baseDirectory,
                             java.io.FileFilter filter,
                             boolean recurse)
                      throws java.io.IOException
Create a tar file based on a list of files.

If the destination filename ends with .tar.gz or .tgz then the file will be compressed with GZip.

If the destination filename ends with ".tar.bz2" then the file will be compressed with BZip2.

Parameters:
log - Log to log progress to, may be null
tarFile - Destination File
baseDirectory - File denoting the source base directory.
filter - FileFilter to choose what files will be included
recurse - true if to recurse down directories
Throws:
java.io.IOException - on error

createTar

public static void createTar(Log log,
                             java.io.File tarFile,
                             java.io.File baseDirectory,
                             java.util.List<java.io.File> files)
                      throws java.io.IOException
Create a tar file based on a list of files.

If the destination filename ends with .tar.gz or .tgz then the file will be compressed with GZip.

If the destination filename ends with ".tar.bz2" then the file will be compressed with BZip2.

Parameters:
log - Log to log progress to, may be null
tarFile - Destination File
baseDirectory - File denoting the source base directory.
files - List of files to include in the Tar archive
Throws:
java.io.IOException - on error


Copyright © 1998-2010 Retep Development Group. All Rights Reserved.