Unarchive
Allows to uncompress an archive with a .zip extension. For example it can be used to generate an archive of images or files generated by another task.
Json
Example
json
{
"name": "file-conversion-unarchive",
"taskReferenceName": "unarchive",
"description": "The business description of the task",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"mode": "FILE",
"file": "${previous_taskReferenceName.output.file}"
}
}1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
Definition
| Property | Type | Required | Description |
|---|---|---|---|
| The name (or type) of the task | |||
| The unique name of the task in your job. It is used to reference this task in the workflow. | |||
| The functional description of this task in your job. | |||
The type of the task. It must be SUB_WORKFLOW. | |||
| : | true: the job continues if there is an error on this task. false: the job fails. | ||
| Input parameters of the task. See below |
Inputs
| Property | Type | Required | Description |
|---|---|---|---|
| : | FILE: unarchive the file input. FILES: unarchive each archive of the files input. REQUEST: unarchive the archives listed in the request document, each with its own compression method and password. | ||
| An XML file listing the archives to process. See the definition below. | |||
It can reference the output of a previous task, example: ${previous_taskReferenceName.output.file} , or a static file, example: file://assets/file.xml, or a user input, example: ${workflow.input.input_key}. | |||
A valid input. It can reference the output of a previous task, example: ${previous_taskReferenceName.output.files} , or a user input, example: ${workflow.input.input_key}. | |||
| : | - | If no compression method is specified, the application will attempt to detect the most appropriate decompression mode. | |
| If appropriate, the password to decrypt the file | |||
| : | Default: falseWhen set to true, the report generation is skipped and thus the report is not available in the output parameters. | ||
| : | Default: info It defines the log level to be recorded in the report. error < warning < info < debug |
Outputs
| Property | Type | Description |
|---|---|---|
| allFilesTransformed | | YES: all files have been transformed successfully. NO: at least one file has not been transformed. |
| file | The first file found in the archive. Absent when the archive holds no file. | |
| files | All the files found in the archive. | |
| listing | The listing of the temporary files. | |
| report | Report on the integration. View below for more details. |
Input request
Used when mode = REQUEST. Unlike FILE and FILES, it lets each archive carry its own compression method and password.
xml
<Archives>
<Archive>
<Url>https://myaccount.blob.core.windows.net/files/archive.zip</Url>
<Compression-Method>7z</Compression-Method>
<Password>********</Password>
</Archive>
</Archives>1
2
3
4
5
6
7
2
3
4
5
6
7
| XPath | Description | Occurs |
|---|---|---|
Archives | Root of the document | 1 |
./Archive | For each archive to process | 0..* |
./Archive/Url | The url of the archive | 1 |
./Archive/Compression-Method | zip | 7z | tar | gzip. When absent, the compression method is detected. | 0..1 |
./Archive/Password | The password needed to open this archive, if any. | 0..1 |
Output listing
Example
xml
<Files>
<File source="my-zip.zip">
<Path>/folder/image-1.jpg</Path>
<Url>https://pl.com/image-1.jpg</Url>
<Md5>a28ZCRcCSc8orBK+iXxTUw==</Md5>
<Sha256>c4d5710e040627a040f0fd7a6ceddfc642e8cddc8a83a7e6c104d67a2ca493c7</Sha256>
<Size>1954387</Size>
</File>
</Files>1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
Definition
| XPath | Description | Occurs |
|---|---|---|
| Files | Root of the document. | 1 |
| ./File | For each extracted file, across all the archives processed. | 0..* |
| ./File@source | The name of the archive this file came from. | 0..1 |
| ./File/Path | The complete path of the file inside its archive. Always starts with /. | 1 |
| ./File/Url | The url of the extracted file. | 1 |
| ./File/Md5 | The MD5 checksum of the extracted file. | 1 |
| ./File/Sha256 | The SHA-256 checksum of the extracted file. | 1 |
| ./File/Size | The size of the extracted file, in bytes. | 1 |
Output report
Example
xml
<Report task="file-conversion-unarchive" start-at="2023-01-20T13:27:54.810Z" task-cid="..." job-cid="..." end-at="2023-01-20T13:28:51.414Z" duration-ms="56604">
<Input name="mode">(le mode passé en paramètre de la tâche)</Input>
<Input name="request">(l'url du fichier request - si celui-ci est présent)</Input>
<Log type="warning" code="URL_NOT_REACHABLE">
<Metadata name="xpath"></Metadata>
<Metadata name="path">//abc/a.jpg</Metadata>
<Message>The url provided is invalid or the content is unreachable: https://www.google.com/abc/a.jpg</Message>
</Log>
</Report>1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
| XPath | Description | Occurrence |
|---|---|---|
| /Report@task | Task name | 1 |
| /Report/Input | Inputs used in the task | 1..* |
| /Report/Log | For each log | 0..* |
| /Report/ Log @type | Enum: error, warning or info | 1 |
| /Report/ Log / Metadata-Collection | Metadata collection | 0..* |
| /Report/ Log / Metadata-Collection@name | Metadata collection name | 1 |
| /Report/ Log / Metadata | Metadata | 0..* |
| /Report/ Log / Metadata@name | Metadata name | 1 |
| /Report/ Log /Message | Message | 1 |
Log codes
| Code | Severity | Raised when |
|---|---|---|
ARCHIVE_PROCESSED_SUCCESSFULLY | info | An archive was fully processed. |
URL_NOT_REACHABLE | warning | An archive url is invalid or its content cannot be reached. |
UNABLE_TO_EXTRACT_FILE | warning | A single entry of the archive could not be extracted. The others still are. |
UNABLE_TO_OPEN_FILE | error | The archive itself could not be opened. |
INVALID_PASSWORD | error | The password provided does not open the archive. |
ARCHIVE_SIZE_TOO_BIG | error | The archive exceeds the maximum allowed size, which the log states. |
TOO_MANY_FILES | error | The archive holds more entries than allowed; the log gives the count. |
INVALID_XML_FILE | error | In mode = REQUEST, the request document is not valid XML. |
UNARCHIVE_FAILED_TO_UPLOAD | error | An extracted file could not be uploaded. |
Limits and additional notes
| Element | Limit | Best practice |
|---|---|---|
| Input zip file size | 1Go | 100mo |
| Size of all unarchived files | 6Go | 500mo |
| Maximum number of files | 15 000 | 200 |