goldengate.common.tar
Class ZipUtility

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

public class ZipUtility
extends Object

Author:
Frederic Bregier

Constructor Summary
ZipUtility()
           
 
Method Summary
static boolean createZipFromDirectory(String directory, String filename, boolean absolute)
          Create a new Zip from a root directory
static boolean createZipFromFiles(File[] files, String filename)
          Create a new Zip from an array of Files (only name of files will be used)
static boolean createZipFromFiles(List<File> files, String filename)
          Create a new Zip from a list of Files (only name of files will be used)
static void main(String[] args)
           
static List<String> unZip(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

ZipUtility

public ZipUtility()
Method Detail

createZipFromDirectory

public static boolean createZipFromDirectory(String directory,
                                             String filename,
                                             boolean absolute)
Create a new Zip 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

createZipFromFiles

public static boolean createZipFromFiles(List<File> files,
                                         String filename)
Create a new Zip 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

createZipFromFiles

public static boolean createZipFromFiles(File[] files,
                                         String filename)
Create a new Zip 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

unZip

public static List<String> unZip(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.