ColdBox Platform Version 2.6.4

coldbox.system.plugins
Class Zip

WEB-INF.cftags.component
        extended by coldbox.system.FrameworkSupertype
            extended by coldbox.system.Plugin
                extended by coldbox.system.plugins.Zip

public class Zip
extends Plugin

A collections of functions that supports the Zip and GZip functionality by using the Java Zip file API.


Constructor Summary
init(any controller)
 
Method Summary
 boolean addFiles(string zipFilePath, [string files=''], [string directory=''], [string filter=''], [boolean recurse='no'], [numeric compression='9'], [boolean savePaths='no'])
          Add files to a new or an existing Zip file archive
 boolean deleteFiles(string zipFilePath, string files)
          Delete files from an existing Zip file archive
 boolean extract(string zipFilePath, [string extractPath='[runtime expression]'], [string extractFiles], [boolean useFolderNames='yes'], [boolean overwriteFiles='no'])
          Extracts a specified Zip file into a specified directory
 boolean gzipAddFile(string gzipFilePath, string filePath)
          Create a new GZip file archive
 boolean gzipExtract(string gzipFilePath, [string extractPath='[runtime expression]'])
          Extracts a specified GZip file into a specified directory
 query list(string zipFilePath)
          List the content of a specified Zip file
 
Methods inherited from class coldbox.system.Plugin
getPluginDescription, getPluginName, getPluginVersion, getRequestCollection, getRequestContext, getpluginAuthor, getpluginAuthorURL, getpluginPath, setPluginDescription, setPluginName, setPluginVersion, setpluginAuthor, setpluginAuthorURL
 
Methods inherited from class coldbox.system.FrameworkSupertype
$abort, $dump, $htmlhead, $include, $rethrow, $throw, addAsset, announceInterception, getColdboxOCM, getController, getDatasource, getDebugMode, getHash, getInstance, getInterceptor, getMailSettings, getModel, getModuleSettings, getMyPlugin, getPlugin, getResource, getSetting, getSettingStructure, getSettingsBean, getfwLocale, includeUDF, locateDirectoryPath, locateFilePath, persistVariables, populateModel, relocate, renderExternalView, renderView, runEvent, setDebugMode, setNextEvent, setNextRoute, setSetting, setfwLocale, settingExists
 
Methods inherited from class WEB-INF.cftags.component
 

Constructor Detail

init

public init(any controller)

Parameters:
controller
Method Detail

addFiles

public boolean addFiles(string zipFilePath, [string files=''], [string directory=''], [string filter=''], [boolean recurse='no'], [numeric compression='9'], [boolean savePaths='no'])
Add files to a new or an existing Zip file archive.

Parameters:
zipFilePath - Pathname of the Zip file to add files.
files - | (Chr(124)) delimited list of files to add to the Zip file. Required if argument 'directory' is not set.
directory - Absolute pathname of directory to add to the Zip file. Required if argument 'files' is not set.
filter - File extension filter. One filter can be applied. Only if argument 'directory' is set.
recurse - Get recursive files of subdirectories. Only if argument 'directory' is set.
compression - Compression level (0 through 9, 0=minimum, 9=maximum).
savePaths - Save full path info.

deleteFiles

public boolean deleteFiles(string zipFilePath, string files)
Delete files from an existing Zip file archive.

Parameters:
zipFilePath - Pathname of the Zip file to delete files from.
files - | (Chr(124)) delimited list of files to delete from Zip file.

extract

public boolean extract(string zipFilePath, [string extractPath='[runtime expression]'], [string extractFiles], [boolean useFolderNames='yes'], [boolean overwriteFiles='no'])
Extracts a specified Zip file into a specified directory.

Parameters:
zipFilePath - Pathname of the Zip file to extract.
extractPath - Pathname to extract the Zip file to.
extractFiles - | (Chr(124)) delimited list of files to extract.
useFolderNames - Create folders using the pathinfo stored in the Zip file.
overwriteFiles - Overwrite existing files.

gzipAddFile

public boolean gzipAddFile(string gzipFilePath, string filePath)
Create a new GZip file archive.

Parameters:
gzipFilePath - Pathname of the GZip file to create.
filePath - Pathname of a file to add to the GZip file archive.

gzipExtract

public boolean gzipExtract(string gzipFilePath, [string extractPath='[runtime expression]'])
Extracts a specified GZip file into a specified directory.

Parameters:
gzipFilePath - Pathname of the GZip file to extract.
extractPath - Pathname to extract the GZip file to.

list

public query list(string zipFilePath)
List the content of a specified Zip file.

Parameters:
zipFilePath - Pathname of the Zip file to list the content.

ColdBox Platform Version 2.6.4