OpenAPI 1.0

com.aquafold.openapi.archive
Interface AQArchive


public interface AQArchive

Archive

Synopsis:

A collection of different methods and algorithms to archive files.

Description:
The archive object provides a list of different file archival options for files on the system in which the application is running. See below for details of the individual functions.


Method Summary
 void bunzip2(String zipFile, String destination)
          Expands a file that has been compressed with the BZIP2 algorithm.
 void bzip2(String sourceFile, String zipFile)
          Compresses a file with the BZIP2 algorithm.
 void cab(AQFileSet fileSet, String cabFile)
          Creates a Microsoft CAB archive file.
 void cab(String sourceDirectory, String cabFile)
          Creates a Microsoft CAB archive file.
 void ear(AQFileSet[] fileSets, String earFile, String appXMLFile)
          An extension of the Jar task with special treatment for a collection of AQFileSets that ends up as an EAR (Enterprise Archive).
 void ear(AQFileSet fileSet, String earFile, String appXMLFile)
          An extension of the Jar task with special treatment for an AQFileSet that ends up as an EAR file.
 void ear(String sourceDirectory, String earFile, String appXMLFile)
          An extension of the Jar task with special treatment for a directory that ends up as an EAR file.
 void gunzip(String zipFile, String destination)
          Expands a file that has been compressed with the GZIP algorithm.
 void gzip(String sourceFile, String zipFile)
          Compresses a file with the GZIP algorithm.
 void jar(AQFileSet[] fileSets, String jarFile)
          Jars a set of files as defined in an AQFileSet.
 void jar(AQFileSet fileset, String jarFile)
          Jars a set of file as defined in an array of fileset
 void jar(String sourceDirectory, String jarFile)
          Jars a set of files specified in a directory.
 void manifest(String manifestFile, Map<String,String> attributeMap, Map<String,Map<String,String>> sectionMap)
          Creates a manifest file, a specific file contained within a JAR archive.
 void signjar(String jarFile, String alias, String keyStore, String storePass)
          Signs a jar file with jarsigner, the JAR Signing and Verification command-line tool.
 void tar(AQFileSet[] fileSets, String tarFile)
          Create a tar archive from a set of files defined as an AQFileSet.
 void tar(AQFileSet fileSet, String tarFile)
          Creates a tar archive from an AQFileSet.
 void tar(String sourceDirectory, String tarFile)
          Creates a tar archive from a directory.
 void unjar(String jarFile, String destinationDirectory)
          Unzips a jar file.
 void untar(String tarFile, String destinationDirectory)
          Untars a tar file.
 void unwar(String warFile, String destinationDirectory)
          Unzips a war file.
 void unzip(String zipFile, String destinationDirectory)
          Unzips a zip file.
 void war(AQFileSet[] fileSets, String warFile, String webXMLFile)
          An extension of the Jar task with special treatment for a collection of AQFileSets that ends up WAR (Web Application Archive) file.
 void war(AQFileSet fileSet, String warFile, String webXMLFile)
          An extension of the Jar task with special treatment for a single AQFileSet that should end up in the WEB-INF/lib, WEB-INF/classes, or WEB-INF directories of the Web Application Archive.
 void war(String sourceDirectory, String warFile, String webXMLFile)
          An extension of the Jar task with special treatment for files that should end up in the WEB-INF/lib, WEB-INF/classes, or WEB-INF directories of the Web Application Archive.
 void zip(AQFileSet[] fileSets, String zipFile)
          Creates a zip file from a list of AQFileSet.
 void zip(AQFileSet fileSet, String zipFile)
          Creates a zip file from a single AQFileSet.
 void zip(String[] sourceDirectoryList, String[] sourceFileList, String zipFile)
          Creates a zip file from a list of directories.
 void zip(String source, String zipFile)
          Creates a zip file.
 

Method Detail

bunzip2

void bunzip2(String zipFile,
             String destination)
             throws Exception
Expands a file that has been compressed with the BZIP2 algorithm. If destination is a directory the name of the destination file is the same as zipFile(with the ".bz2" extension removed if present). If destination is omitted, the parent directory of zipFile is taken. The file is only expanded if the source resource is newer than the destination file, or when the destination file does not exist.

Parameters:
zipFile - The file to expand; required.
destination - The destination file or directory.
Throws:
Exception - on error

bzip2

void bzip2(String sourceFile,
           String zipFile)
           throws Exception
Compresses a file with the BZIP2 algorithm. Normally used to compress non-compressed archives such as TAR files.

Parameters:
sourceFile - The file to compress; required.
zipFile - The location of the compressed file; required.
Throws:
Exception - on error

cab

void cab(String sourceDirectory,
         String cabFile)
         throws Exception
Creates a Microsoft CAB archive file. This task will work on Windows using the external cabarc tool (provided by Microsoft), which must be located in your executable path.

Parameters:
sourceDirectory - The directory from which to archive files; required
cabFile - The location/file of where to create the CAB file; required.
Throws:
Exception - If cabFile is a directory or is null. If sourceDirectory does not exist or is null.

cab

void cab(AQFileSet fileSet,
         String cabFile)
         throws Exception
Creates a Microsoft CAB archive file. This task will work on Windows using the external cabarc tool (provided by Microsoft), which must be located in your executable path.

Parameters:
fileSet - The set of files to be added to the CAB archive.
cabFile - The location/file for where to create the CAB file; required.
Throws:
Exception - If cabFile is a directory or is null. If sourceDirectory does not exist or is null.

ear

void ear(String sourceDirectory,
         String earFile,
         String appXMLFile)
         throws Exception
An extension of the Jar task with special treatment for a directory that ends up as an EAR file.

Parameters:
sourceDirectory - The directory from which to archive files.
earFile - The archived file; required.
appXMLFile - File to incorporate as application.xml; optional if earFile already exists, otherwise required. Hence, if the EAR file is created for the first time, this parameter is required. If the parameter is optional, use null.
Throws:
Exception - on error

ear

void ear(AQFileSet[] fileSets,
         String earFile,
         String appXMLFile)
         throws Exception
An extension of the Jar task with special treatment for a collection of AQFileSets that ends up as an EAR (Enterprise Archive). EAR file is a JAR file that contains a J2EE application.

Parameters:
fileSets - The list of files to be added to the archive.
earFile - The archived file; required.
appXMLFile - File to incorporate as application.xml; optional if earFile already exists, otherwise required. Hence, if the EAR file is created for the first time, this parameter is required. If the parameter is optional, use null.
Throws:
Exception - on error

ear

void ear(AQFileSet fileSet,
         String earFile,
         String appXMLFile)
         throws Exception
An extension of the Jar task with special treatment for an AQFileSet that ends up as an EAR file.

Parameters:
fileSet - The list of files to be added to the archive.
earFile - The archived file; required.
appXMLFile - File to incorporate as application.xml; optional if earFile already exists, otherwise required. Hence, if the EAR file is created for the first time, this parameter is required. If the parameter is optional, use null.
Throws:
Exception - on error

gunzip

void gunzip(String zipFile,
            String destination)
            throws Exception
Expands a file that has been compressed with the GZIP algorithm. If destination is a directory the name of the destination file is the same as zipFile(with the ".gz" extension removed if present). If destination is omitted, the parent directory of zipFile is taken. The file is only expanded if the source resource is newer than the destination file, or when the destination file does not exist.

Parameters:
zipFile - The archived file; required.
destination - The destination file or directory.
Throws:
Exception - on error

gzip

void gzip(String sourceFile,
          String zipFile)
          throws Exception
Compresses a file with the GZIP algorithm. Normally used to compress non-compressed archives such as TAR files. The output file is only generated if it doesn't exist or the source resource is newer.

Parameters:
sourceFile - The file to compress; required;
zipFile - The compressed file; required;
Throws:
Exception - on error

jar

void jar(String sourceDirectory,
         String jarFile)
         throws Exception
Jars a set of files specified in a directory. If the jarFile exists, it will be overwritten.

Parameters:
sourceDirectory - The directory from which to archive files; required.
jarFile - The archived file; required.
Throws:
Exception - on error

jar

void jar(AQFileSet[] fileSets,
         String jarFile)
         throws Exception
Jars a set of files as defined in an AQFileSet. JAR(Java Archive) files are means to conveniently package and distribute Java applications and components.

Parameters:
fileSets - The list of files to be added to the archive; required.
jarFile - The archived file; required.
Throws:
Exception - on error

jar

void jar(AQFileSet fileset,
         String jarFile)
         throws Exception
Jars a set of file as defined in an array of fileset

Parameters:
fileset - The list of files to be added to the archive; required.
jarFile - The archived file; required.
Throws:
Exception - on error

manifest

void manifest(String manifestFile,
              Map<String,String> attributeMap,
              Map<String,Map<String,String>> sectionMap)
              throws Exception
Creates a manifest file, a specific file contained within a JAR archive. It is a metadata file that contains name-value pairs organized in different sections. The manifest file is named MANIFEST.MF.

If the manifestFile exists, it will be replaced.

Parameters:
manifestFile - The name of the manifest file to create/update; required.
attributeMap - Configure attributes to be added to the manifest.
sectionMap - Configure sections to be added to the manifest.
Throws:
Exception - on error

signjar

void signjar(String jarFile,
             String alias,
             String keyStore,
             String storePass)
             throws Exception
Signs a jar file with jarsigner, the JAR Signing and Verification command-line tool.

Parameters:
jarFile - The archived file; required.
alias - The alias to sign under; required
keyStore - The keystore file; required.
storePass - The password for keystore integrity; required.
Throws:
Exception - on error

tar

void tar(String sourceDirectory,
         String tarFile)
         throws Exception
Creates a tar archive from a directory.

Parameters:
sourceDirectory - The directory from which to archive files; required.
tarFile - The archived file; required.
Throws:
Exception - on error

tar

void tar(AQFileSet[] fileSets,
         String tarFile)
         throws Exception
Create a tar archive from a set of files defined as an AQFileSet.

Parameters:
fileSets - The list of files to be added to the archive; required.
tarFile - The archived file; required.
Throws:
Exception - on error

tar

void tar(AQFileSet fileSet,
         String tarFile)
         throws Exception
Creates a tar archive from an AQFileSet.

Parameters:
fileSet - The list of files to be added to the archive; required.
tarFile - The archived file; required.
Throws:
Exception - on error

unjar

void unjar(String jarFile,
           String destinationDirectory)
           throws Exception
Unzips a jar file. Any files of the same name found in destinationDirectory will be overwritten regardless of timestamp.

Parameters:
jarFile - The archived file; required.
destinationDirectory - The destination file or directory.
Throws:
Exception - on error

untar

void untar(String tarFile,
           String destinationDirectory)
           throws Exception
Untars a tar file. Any files of the same name found in destinationDirectory will be overwritten regardless of timestamp.

Parameters:
tarFile - The archived file; required.
destinationDirectory - The destination file or directory; required.
Throws:
Exception - on error

unwar

void unwar(String warFile,
           String destinationDirectory)
           throws Exception
Unzips a war file. Any files of the same name found in destinationDirectory will be overwritten regardless of timestamp.

Parameters:
warFile - The archived file; required.
destinationDirectory - The destination file or directory.
Throws:
Exception - on error

unzip

void unzip(String zipFile,
           String destinationDirectory)
           throws Exception
Unzips a zip file. Any files of the same name found in destinationDirectory will be overwritten regardless of timestamp.

Parameters:
zipFile - The archived file; required.
destinationDirectory - The destination file or directory.
Throws:
Exception - on error

war

void war(String sourceDirectory,
         String warFile,
         String webXMLFile)
         throws Exception
An extension of the Jar task with special treatment for files that should end up in the WEB-INF/lib, WEB-INF/classes, or WEB-INF directories of the Web Application Archive. No WEB-INF/web.xml file will be added if webxmlFile is not set. The warFile will be overwritten if there are changes or new files in the sourceDirectory.

Parameters:
sourceDirectory - The directory from which to archive files; required.
warFile - The archived file; required.
webXMLFile - Set the deployment descriptor to use (WEB-INF/web.xml); optional. If the parameter is optional, use null.
Throws:
Exception - on error

war

void war(AQFileSet[] fileSets,
         String warFile,
         String webXMLFile)
         throws Exception
An extension of the Jar task with special treatment for a collection of AQFileSets that ends up WAR (Web Application Archive) file. WAR is a JAR file used to distribute a collection of JavaServer Pages, servlets, Java classes, XML files, tag libraries and static Web pages (HTML and related files) that together constitute a Web application.

Parameters:
fileSets - The list of files to be added to the archive; required.
warFile - The archived file; required.
webXMLFile - Set the deployment descriptor to use (WEB-INF/web.xml); optional. If the parameter is optional, use null.
Throws:
Exception - on error

war

void war(AQFileSet fileSet,
         String warFile,
         String webXMLFile)
         throws Exception
An extension of the Jar task with special treatment for a single AQFileSet that should end up in the WEB-INF/lib, WEB-INF/classes, or WEB-INF directories of the Web Application Archive. No WEB-INF/web.xml file will be added if webxmlFile is not set.

Parameters:
fileSet - The list of files to be added to the archive; required.
warFile - The archived file; required.
webXMLFile - Set the deployment descriptor to use (WEB-INF/web.xml); optional. If the parameter is optional, use null.
Throws:
Exception - on error

zip

void zip(String source,
         String zipFile)
         throws Exception
Creates a zip file. Zero file zipFile cannot be created. zipFile will be overwritten if files are added or updated in source.

Parameters:
source - The file or directory from which to archive; required.
zipFile - The archived file; required.
Throws:
Exception - on error

zip

void zip(String[] sourceDirectoryList,
         String[] sourceFileList,
         String zipFile)
         throws Exception
Creates a zip file from a list of directories. Zero file zipFile cannot be created. zipFile will be overwritten if files are added or updated in sourceDirectoryList or in sourceFileList.

Parameters:
sourceDirectoryList - An array of directories from which to archive files.
sourceFileList - An array of files from which to archive.
zipFile - The archived file; required.
Throws:
Exception - on error

zip

void zip(AQFileSet[] fileSets,
         String zipFile)
         throws Exception
Creates a zip file from a list of AQFileSet. Zero file zipFile cannot be created. zipFile will be overwritten if files are added or updated in fileSets.

Parameters:
fileSets - The list of files to be added to the archive; required.
zipFile - The archived file; required.
Throws:
Exception - on error

zip

void zip(AQFileSet fileSet,
         String zipFile)
         throws Exception
Creates a zip file from a single AQFileSet. Zero file zipFile cannot be created. zipFile will be overwritten if files are added or updated in fileSet.

Parameters:
fileSet - The list of files to be added to the archive; required.
zipFile - The archived file; required.
Throws:
Exception - on error

OpenAPI 1.0


Copyright © 2010 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.