zipCompress

Version 23.4.8839


zipCompress


Compress files or folders into an archive. To compress individual files, use includefile#. To compress folders, use includefolder#.

Required Parameters

  • type: The type of the archive. The allowed values are ZIP, TAR, JAR, and GZIP. The default is ZIP.
  • archive: The path on disk, including the filename, where the operation should place the archive.
  • includefile#: An array of files to include in the archive. For example, to archive two files, set the filepath to those files in includefile#1 and includefile#2. See Introduction to ArcScript for more information on array attributes in ArcScript.
  • includefolder#: An array of folders to include in the archive. For example, to archive two folders, set the filepath to those folders in includefolder#1 and includefolder#2.

Optional Parameters

  • manifest: The location of the manifest file. Only valid for JAR archives.

Output Attributes

  • zip:result: If the operation is successful, SUCCESS is returned.

Example

This example compresses two folders (/tmp/foo and /tmp/bar) and places them in a gzip archive located at /home/mydata.gzip.

<!-- Creating the input item and the necessary attributes -->
<arc:set attr="zip.archive" value="/home/mydata.gzip" />
<arc:set attr="zip.type" value="GZIP" />
<arc:set attr="zip.includefolder#1" value="/tmp/foo" />
<arc:set attr="zip.includefolder#2" value="/tmp/bar" />

<arc:call op="zipCompress" in="zip">
  <!-- Optional logging step to log the status of the operation to the application log. -->
  <arc:set attr="_log.info" value="The zipCompress operation for connector [ConnectorId] has finished with a status of [results.zip:result]." />
</arc:call>