IPublishPostProcessPlugin - IshCompress
Compresses the file or folder specified in the items collection by the given key.
Plugin Input
Plugin configuration parameters
| Parameter | Required | Default value | Allowed values | Description |
|---|---|---|---|---|
| FullPathToCompressContextItemsKey | Yes | Valid key name, present in items collection | Item key of the item containing the full path of a file or a folder to compress.
| |
| CompressedFilePathItemKey | Yes | The name of key of output parameter to be added to Items collection | The output value with the full path to the archive file will be added to the context.Items collection and assigned to this key.
| |
| CompressionLevel | No | Optimal | Fastest, NoCompression, Optimal | The compression level. Use Fastest if the compression operation should complete as quickly as possible, even if the resulting file is not optimally compressed. Use NoCompression if no compression should be performed on the file. Use Optimal if the compression operation should be optimally compressed, even if the operation takes a longer time to complete. |
| IncludeBaseDirectory | No | No | Yes, No | Specifies whether or not to include the folder name at the root of the archive. Only applicable if a folder path was provided via the FullPathToCompressContextItemsKey parameter. |
Plugin Outcome
Changes made to the file system:
- Zip file created.
Values set in the
context.Items collection as a result
| Item Key | Typical Value | Item Value Type | Description |
|---|---|---|---|
The name of key is specified in the input parameter CompressedFilePathItemKey | String | The full path of the compressed file created. |
plugin name="ISHCOMPRESSPUBLISHRESULT" example
<plugin name="ISHCOMPRESSPUBLISHRESULT" handler="IshCompress">
<description>Compresses the file with the publish result specified in the Items collection.</description>
<initialize>
<parameters>
<parameter name="FullPathToCompressContextItemsKey">ExtendedOverallPackageObjectFilePath</parameter>
<parameter name="CompressedFilePathItemKey">CompressedFilePath</parameter>
<parameter name="CompressionLevel">Optimal</parameter>
<parameter name="IncludeBaseDirectory">No</parameter>
</parameters>
</initialize>
</plugin>
Plugin flow
IshCompress does the following:
- Compresses the file or folder specified in the items collection by the given key.
- If the file path specified in the items collection points to the file, compresses the specified file and stores the compressed file next to the original file. The name of the compressed file is the name of the original file with the extension changed to .zip.
- If the file path specified in the items collection points to the folder, compresses the specified folder and stores the compressed file inside that folder. The name of the compressed file is the name of the folder + .zip extension.
- The path to the result will be written to the Items collection with the corresponding key, which is specified in the parameter
CompressedFilePathItemKey.