railo.commons.io
Class CompressUtil

java.lang.Object
  extended by railo.commons.io.CompressUtil

public final class CompressUtil
extends Object

Util to manipulate zip files


Field Summary
static int FORMAT_BZIP
          Field FORMAT_BZIP
static int FORMAT_BZIP2
          Field FORMAT_BZIP
static int FORMAT_GZIP
          Field FORMAT_GZIP
static int FORMAT_TAR
          Field FORMAT_TAR
static int FORMAT_TBZ
          Field FORMAT_TBZ
static int FORMAT_TBZ2
          Field FORMAT_TBZ2
static int FORMAT_TGZ
          Field FORMAT_TGZ
static int FORMAT_ZIP
          Field FORMAT_ZIP
 
Method Summary
static void compress(int format, Resource[] sources, Resource target, int mode)
          compress data to a zip file
static void compress(int format, Resource source, Resource target, boolean includeBaseFolder, int mode)
          compress data to a zip file
static void compressGZip(InputStream source, OutputStream target)
           
static void compressTar(Resource[] sources, OutputStream target, int mode)
           
static void compressTar(Resource[] sources, Resource target, int mode)
          compress a source file/directory to a tar file
static void compressTar(String parent, Resource[] sources, org.apache.commons.compress.archivers.tar.TarArchiveOutputStream tos, int mode)
           
static void compressTGZ(Resource[] sources, Resource target, int mode)
          compress a source file/directory to a tar/gzip file
static void compressZip(Resource[] sources, Resource target, ResourceFilter filter)
          compress a source file/directory to a zip file
static void compressZip(Resource[] sources, ZipOutputStream zos, ResourceFilter filter)
           
static void extract(int format, Resource[] sources, Resource target)
          extract a zip file to a directory
static void extract(int format, Resource source, Resource target)
          extract a zip file to a directory
static void main(String[] args)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FORMAT_ZIP

public static final int FORMAT_ZIP
Field FORMAT_ZIP

See Also:
Constant Field Values

FORMAT_TAR

public static final int FORMAT_TAR
Field FORMAT_TAR

See Also:
Constant Field Values

FORMAT_TGZ

public static final int FORMAT_TGZ
Field FORMAT_TGZ

See Also:
Constant Field Values

FORMAT_GZIP

public static final int FORMAT_GZIP
Field FORMAT_GZIP

See Also:
Constant Field Values

FORMAT_BZIP

public static final int FORMAT_BZIP
Field FORMAT_BZIP

See Also:
Constant Field Values

FORMAT_BZIP2

public static final int FORMAT_BZIP2
Field FORMAT_BZIP

See Also:
Constant Field Values

FORMAT_TBZ

public static final int FORMAT_TBZ
Field FORMAT_TBZ

See Also:
Constant Field Values

FORMAT_TBZ2

public static final int FORMAT_TBZ2
Field FORMAT_TBZ2

See Also:
Constant Field Values
Method Detail

extract

public static void extract(int format,
                           Resource source,
                           Resource target)
                    throws IOException
extract a zip file to a directory

Parameters:
format -
source -
target -
Throws:
IOException

extract

public static void extract(int format,
                           Resource[] sources,
                           Resource target)
                    throws IOException
extract a zip file to a directory

Parameters:
format -
sources -
target -
Throws:
IOException

compress

public static void compress(int format,
                            Resource source,
                            Resource target,
                            boolean includeBaseFolder,
                            int mode)
                     throws IOException
compress data to a zip file

Parameters:
format - format it that should by compressed usally is CompressUtil.FORMAT_XYZ
source -
target -
includeBaseFolder -
mode -
Throws:
IOException

compress

public static void compress(int format,
                            Resource[] sources,
                            Resource target,
                            int mode)
                     throws IOException
compress data to a zip file

Parameters:
format - format it that should by compressed usally is CompressUtil.FORMAT_XYZ
sources -
target -
mode -
Throws:
IOException

compressTGZ

public static void compressTGZ(Resource[] sources,
                               Resource target,
                               int mode)
                        throws IOException
compress a source file/directory to a tar/gzip file

Parameters:
sources -
target -
mode -
Throws:
IOException

compressGZip

public static void compressGZip(InputStream source,
                                OutputStream target)
                         throws IOException
Throws:
IOException

compressZip

public static void compressZip(Resource[] sources,
                               Resource target,
                               ResourceFilter filter)
                        throws IOException
compress a source file/directory to a zip file

Parameters:
sources -
target -
filter -
Throws:
IOException

compressZip

public static void compressZip(Resource[] sources,
                               ZipOutputStream zos,
                               ResourceFilter filter)
                        throws IOException
Throws:
IOException

compressTar

public static void compressTar(Resource[] sources,
                               Resource target,
                               int mode)
                        throws IOException
compress a source file/directory to a tar file

Parameters:
sources -
target -
mode -
Throws:
IOException

compressTar

public static void compressTar(Resource[] sources,
                               OutputStream target,
                               int mode)
                        throws IOException
Throws:
IOException

compressTar

public static void compressTar(String parent,
                               Resource[] sources,
                               org.apache.commons.compress.archivers.tar.TarArchiveOutputStream tos,
                               int mode)
                        throws IOException
Throws:
IOException

main

public static void main(String[] args)
                 throws IOException
Throws:
IOException


Copyright © 2012 Railo