Class ZipTransformer

All Implemented Interfaces:
Aware, BeanFactoryAware, BeanNameAware, InitializingBean, ApplicationContextAware, ExpressionCapable, GenericTransformer<Message<?>,Message<?>>, NamedComponent, Transformer

public class ZipTransformer extends AbstractZipTransformer
Transformer implementation that applies a Zip transformation to the message payload. Keep in mind that Zip entry timestamps are recorded only to 2 second precision:

See also:

If you want to generate Zip files larger than 4GB, you must use Java 7:

See also:

Since:
6.1
Author:
Gunnar Hillert, Artem Bilan
  • Constructor Details

    • ZipTransformer

      public ZipTransformer()
  • Method Details

    • setCompressionLevel

      public void setCompressionLevel(int compressionLevel)
      Set the compression level. Default is Deflater.DEFAULT_COMPRESSION.
      Parameters:
      compressionLevel - Must be an integer value from 0-9.
    • setUseFileAttributes

      public void setUseFileAttributes(boolean useFileAttributes)
      Specify whether the name of the file shall be used for the zip entry.
      Parameters:
      useFileAttributes - Defaults to true if not set explicitly
    • doZipTransform

      protected Object doZipTransform(Message<?> message)
      The payload may encompass the following types: When providing an Iterable, nested Iterables are not supported. However, payloads can be any of the other supported types.
      Specified by:
      doZipTransform in class AbstractZipTransformer
      Parameters:
      message - The message will never be null.
      Returns:
      The result of the Zip transformation.