Compression - Verify

Declaration

<AMCOMPRESSION ACTIVITY="verify_compression" ARCHIVEFILE="text" RESULTVARIABLE="text" RESULTDATASET="text" TYPE="text (options)" PASSWORD="text (encrypted)" />

Related Topics   

Description

Verifies if one or more compressed files are valid and not corrupted, ensuring decompression can occur without issues. To verify more than one file, use wildcard characters (for example, * or ?). To specify multiple files or wildcard masks, separate them with the pipe character (|) (for example, c:\temp\*.txt|c:\backup\*.bak). See File Masks & Wildcards for more details.

Practical usage

Used to verify if one or more compressed files received by way of Email, FTP, HTTP, or other means are valid and not corrupted, ensuring decompression can occur without issues.

Parameters

General

Property Type Required Default Markup Description
Archive file(s) Text Yes (Empty)
  • FILE="c:\source\file.zip"
  • FILE="c:\source\*.zip"
Specifies the files to verify. This can be a fully qualified path and file name (preferred) or a single file (requires use of the File System - Change folder activity). You can use wildcard characters (for example, * or ?) to specify all files matching a certain mask. You can specify multiple files and file masks by separating each entry with a pipe character (|) (for example, c:\temp\*.txt|c:\backup\*.bak). See File Masks & Wildcards for more details.
NOTE: Files with invalid paths are ignored at runtime.
Compression type Text (options) Yes Zip
  • TYPE="jar"
  • TYPE="gzip"
  • TYPE="tar"
  • TYPE="bzip2"
  • TYPE="tar+gzip"
  • TYPE="cab"
  • TYPE="7zip"
Indicates the compression type of the files to be verified. The available options are:
  • ZIP (default)
  • JAR
  • GZIP
  • TAR
  • BZIP2
  • TAR+GZIP
  • CAB
  • 7ZIP
Use this password if needed Text No (Empty) PASSWORD="encrypted" The password (if required) to extract the file. This parameter is required only if a password was previously set in the properties of the Compress activity.
Populate variable with result Text Yes (Empty) RESULTVARIABLE="theVariableName" The name of the existing variable to populate with the results of the file verification.
Create and populate dataset Text Yes (Empty) RESULTDATABASE="theDataset"

The name of the dataset to populate with the results of the file verification. More details regarding the fields that this dataset creates can be found below under Datasets.

Description

Error Causes

On Error

Additional notes

Datasets

A dataset is a multiple column, multiple row container object. This activity creates and populates a dataset containing a specific set of fields. The table below describes the file/folder related dataset fields created and populated (assuming the dataset name assigned was theDataset).

Name Data Type Return Value
theDataset.File String Returns the file name and path of the compressed file.
theDataset.Verified True/False Returns TRUE for files passing verification, otherwise, returns FALSE for files that fail.

Example

NOTE:
  • Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
  • To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.

Description

This sample task verifies if a compressed file is valid and then creates and populates a dataset with the results.

Copy
<AMVARIABLE NAME="Verification" VALUE="%%" />
<AMCOMPRESSION ACTIVITY="verify_compression" ARCHIVEFILE="C:\temp\records.zip" RESULTVARIABLE="Verification" RESULTDATASET="Results" />