Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »


Disclaimer

Your use of this download is governed by Stonebranch’s Terms of Use, which are available at https://www.stonebranch.com/integration-hub/Terms-and-Privacy/Terms-of-Use/

Overview

File compression is a way to reduce overall file size without losing any of the primary data to make large files more manageable.

This Universal Extension provides the capability to compress and decompress a file, with or without password encryption.

Software Requirements

This solution-pack requires a Universal Agent and a Python runtime to execute the Universal Task.

Software Requirements for /wiki/spaces/UC71x/pages/5178050 and /wiki/spaces/UC71x/pages/5180675

Requires Python 3.7.0 or higher. Tested with the Universal Agent bundled Python distribution.

Software Requirements for Universal Agent

Both Windows and Linux agents are supported:

  • Universal Agent for Windows x64 Version 7.0.0.0 and later with python options installed.

  • Universal Agent for Linux Version 7.0.0.0 and later with python options installed.

This Universal Extension is using 7zip command line tool.

  • 7-zip or p7zip version 15.05 or newer is required to be installed in Universal Agent, tested with 7-zip 21.06 and p7zip 16.02.

Notes about 7-Zip and p7zip

Excerpt from 7-Zip readme file. There are two different ports of 7-Zip for Linux:

  1. p7zip - another port of 7-Zip for Linux, made by an independent developer. The latest version of p7zip now is 16.02, and that p7zip 16.02 is outdated now.

  2. 7-Zip for Linux/macOS - this package - it's new code with all changes from latest 7-Zip for Windows.

These two ports are not identical. Note also that some Linux specific things can be implemented better in p7zip than in new 7-Zip for Linux.

There are several main executables in 7-Zip and p7zip:

  • 7zz (7-Zip)
    Stand-alone full version of 7-Zip that supports all formats.

  • 7zzs (7-Zip)
    Stand-alone full version of 7-Zip that supports all formats (static library linking).

  • 7z (p7zip)
    7-Zip that requires 7z.so shared library, and it supports all formats via 7z.so.

  • 7za (p7zip)
    Stand-alone version of 7-Zip that supports some main formats: 7z, xz, lzma, zip, bzip2, gzip, tar, cab, ppmd and split.

7zzs is similar to 7zz, but 7zzs was compiled for static library linking, so 7zzs does not use external shared library (".so") files.

You can use 7zzs if 7zz does not work due to lack of required shared library (".so") files. The command line syntax for executables from p7zip is similar to 7zz syntax from this package.

See the 7-Zip website for more information.

Software Requirements for Universal Controller

Universal Controller Version 7.0.0.0 and later.

Key Features

This Universal Extension provides the following main features:

  • Support to compress and decompress a file with zip deflate method.

  • Support for AES-256 password encryption.

Import Universal Template

To use the Universal Template, you first must perform the following steps:

  1. This Universal Task requires the /wiki/spaces/UC71x/pages/5178443 feature. Check that the/wiki/spaces/UC71x/pages/5177877 system property has been set to true.

  2. Download the provided ZIP file.

  3. In the Universal Controller UI, select Configuration > Universal Templates to display the current list of /wiki/spaces/UC71x/pages/5178054.

  4. Click Import Template.

  5. Select the template ZIP file and Import.

When the template has been imported successfully, the Universal Template will appear on the list. Refresh your Navigation Tree to see these tasks in the Automation Center Menu.

Configure Universal Task

For the new Universal Task type, create a new task and enter the task-specific details that were created in the Universal Template.

Input Fields

The input fields for this Universal Extension are described in the following table.

Field

Input type

Default value

Type

Description

Action

Required

Compress file

Choice

The action performed upon the task execution.

Available options are:

  • Compress file

  • Decompress file

Algorithm

Required

zip

Choice

The compression algorithm to be used upon the action execution.

Available option is:

  • zip

Archiver Tool

Required

7za: 7-Zip (Windows) or p7zip (Linux) - standalone

Choice

The archiver tool to be used upon the action execution.

Available options are:

  • 7za: 7-Zip (Windows) or p7zip (Linux) - standalone

  • 7z: 7-Zip (Windows) or p7zip (Linux) - full

  • 7zz: 7-Zip (Linux) - full

  • 7zzs: 7-Zip (Linux) - standalone

  • 7-zip(custom path)

Archiver Path

Optional

-

Text

Custom path and file name for the archiver tool.

Required when Archiver Tool is configured for "7-zip(custom path)".

Source file

Required

-

Text

Path and file name of the file to compress or the archive to extract.

Archive

Optional

-

Text

Path and file name of the target archive file.

Default value will be Source File with the algorithm archive suffix.

Used when Action is configured for "Compress file".

File

Optional

-

Text

The file to be extracted.

If value is empty, then default extraction of the archive content.

Used when Action is configured for "Decompress file".

Zip Compression Level

Required

5 - Normal

Choice

The level of compression.

Available options are:

  • 1 - Fastest

  • 3 - Fast

  • 5 - Normal

  • 7 - Maximum

  • 9 - Ultra

Delete Original

Required

True

Boolean

Flag to configure for whether the Source File should be deleted at the end of compression.

Used when Action is configured for "Compress file".

Overwrite

Required

False

Boolean

Flag to specify the overwrite mode during extraction.

Used when Action is configured for "Decompress file".

Encryption

Required

None

Choice

The encryption algorithm for password protection of the archive.

Available options are:

  • None

  • AES-256

Password Credentials

Optional

-

Credentials

The password to be used for the compression or decompression.

Required when Encryption is configured for "AES-256".

Additional switches

Optional

-

Text

Specifies additional parameters to be passed to the archiver tool, separated by empty spaces.

Task Examples

Compress File with AES-256 Password Encryption

Example of Universal Task for compressing file with AES-256 password encryption.


Decompress File with 7-zip(custom path) Archiver Tool

Example of Universal Task for decompressing file with 7zip(custom path) Archiver Tool.

Task Output

Exit Codes

The exit codes for this Universal Extension are described in the following table.

Exit Code

Status Classification Code

Status Classification Description

Status Description

0

SUCCESS

Successful Execution

SUCCESS: Successful Task execution

1

FAIL

Failed Execution

FAIL: < Error Description >

11

FAIL

Warning (Non fatal error(s)).

For example, one or more files were locked by some other application, so they were not compressed.

FAIL: Warning

12

FAIL

Fatal error

FAIL: Fatal error

17

FAIL

Command line error

FAIL: Command line error

18

FAIL

Not enough memory for operation

FAIL: Not enough memory for operation

20

DATA_VALIDATION_ERROR

Bad input fields validation

DATA_VALIDATION_ERROR: Some of the input fields cannot be validated.

See STDERR for more details

255

FAIL

User stopped the process

FAIL: User stopped the process

Extension Output

The Extension Output for this Universal Extension is described below.

{
    "exit_code": 0,
    "status_description": "SUCCESS: Task executed successfully.",
    "changed": true,
    "invocation": {
        "extension": "1.0.0",
        "version": "ue-util-compress",
        "fields": {
            "action": "compress",
            "algorithm": "zip",
            "zip_compression_level": 5,
            "source_file": "/tests/test_file.txt",
            "archive": "/tests/test_archive.zip",
            "file": null,
            "overwrite": false,
            "encryption": "AES256",
            "credentials": "********",
            "delete_original": true,
            "archiver_tool": "7zz",
            "archiver_path": null,
            "additional_switches": ""
        }
    },
    "result": {
        "archive": {
            "archiver": "7-Zip (z) 21.06 (x64) ",
            "size_expanded": 1073741824,
            "size_compressed": 1260173
        }
    }
}


Document References

This document references the following documents:

Name

Location

Description

Universal Templates

https://docs.stonebranch.com/confluence/display/UC71x/Universal+Templates

User documentation for creating Universal Templates in the Universal Controller user interface.

Universal Tasks

https://docs.stonebranch.com/confluence/display/UC71x/Universal+Tasks

User documentation for creating Universal Tasks in the Universal Controller user interface.

7zip Official Page

https://www.7-zip.org/download.html

User documentation for downloading 7zip command line tool.



  • No labels