Class AbstractZipTransformer

All Implemented Interfaces:
Aware, BeanFactoryAware, BeanNameAware, InitializingBean, ApplicationContextAware, ExpressionCapable, GenericTransformer<Message<?>,Message<?>>, NamedComponent, Transformer
Direct Known Subclasses:
UnZipTransformer, ZipTransformer

public abstract class AbstractZipTransformer extends AbstractTransformer
Base class for transformers that provide Zip compression.
Gunnar Hillert, Artem Bilan
  • Field Details

    • charset

      protected Charset charset
    • fileNameGenerator

      protected FileNameGenerator fileNameGenerator
    • zipResultType

      protected ZipResultType zipResultType
    • workDirectory

      protected File workDirectory
    • deleteFiles

      protected boolean deleteFiles
  • Constructor Details

    • AbstractZipTransformer

      public AbstractZipTransformer()
  • Method Details

    • setDeleteFiles

      public void setDeleteFiles(boolean deleteFiles)
      If the payload is an instance of File, this property specifies whether to delete the File after transformation. Default is false.
      deleteFiles - Defaults to false if not set
    • setWorkDirectory

      public void setWorkDirectory(File workDirectory)
      Set the work-directory. The work directory is used when the ZipResultType is set to ZipResultType.FILE. By default, this property is set to the System temporary directory containing a subdirectory "ziptransformer".
      workDirectory - Must not be null and must not represent a file.
    • setZipResultType

      public void setZipResultType(ZipResultType zipResultType)
      Define the format of the data returned after transformation. Available options are:
      • File
      • Byte Array
      Defaults to ZipResultType.FILE.
      zipResultType - Must not be null
    • onInit

      protected void onInit()
      Description copied from class: IntegrationObjectSupport
      Subclasses may implement this for initialization logic.
      onInit in class IntegrationObjectSupport
    • doTransform

      protected Object doTransform(Message<?> message)
      Description copied from class: AbstractTransformer
      Subclasses must implement this method to provide the transformation logic. If the return value is itself a Message, it will be used as the result. Otherwise, any non-null return value will be used as the payload of the result Message.
      Specified by:
      doTransform in class AbstractTransformer
      message - the message and its payload must not be null.
      The result of the transformation.
    • doZipTransform

      protected abstract Object doZipTransform(Message<?> message)
      Subclasses must implement this method to provide the Zip transformation logic.
      message - The message will never be null.
      The result of the Zip transformation.