goldengate.common.tar
Class TarUtility

java.lang.Object
  extended by goldengate.common.tar.TarUtility

public class TarUtility
extends Object

TAR support

Author:
Frederic Bregier

Constructor Summary
TarUtility()
           
 
Method Summary
static boolean createTarFromDirectory(String directory, String filename, boolean absolute)
          Create a new Tar from a root directory
static boolean createTarFromFiles(File[] files, String filename)
          Create a new Tar from an array of Files (only name of files will be used)
static boolean createTarFromFiles(List<File> files, String filename)
          Create a new Tar from a list of Files (only name of files will be used)
static void main(String[] args)
           
static List<String> unTar(File tarFile, File directory)
          Extract all files from Tar into the specified directory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TarUtility

public TarUtility()
Method Detail

createTarFromDirectory

public static boolean createTarFromDirectory(String directory,
                                             String filename,
                                             boolean absolute)
Create a new Tar from a root directory

Parameters:
directory - the base directory
filename - the output filename
absolute - store absolute filepath (from directory) or only filename
Returns:
True if OK

createTarFromFiles

public static boolean createTarFromFiles(List<File> files,
                                         String filename)
Create a new Tar from a list of Files (only name of files will be used)

Parameters:
files - list of files to add
filename - the output filename
Returns:
True if OK

createTarFromFiles

public static boolean createTarFromFiles(File[] files,
                                         String filename)
Create a new Tar from an array of Files (only name of files will be used)

Parameters:
files - array of files to add
filename - the output filename
Returns:
True if OK

unTar

public static List<String> unTar(File tarFile,
                                 File directory)
                          throws IOException
Extract all files from Tar into the specified directory

Parameters:
tarFile -
directory -
Returns:
the list of extracted filenames
Throws:
IOException

main

public static void main(String[] args)


Copyright © 2009-2012 Frederic Bregier. All Rights Reserved.