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:

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.
      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.
      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
      message - The message will never be null.
      The result of the Zip transformation.