Class AbstractZipTransformer
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.transformer.AbstractTransformer
org.springframework.integration.zip.transformer.AbstractZipTransformer
- All Implemented Interfaces:
- Aware,- BeanFactoryAware,- BeanNameAware,- InitializingBean,- ApplicationContextAware,- ExpressionCapable,- GenericTransformer<Message<?>, Message<?>>,- NamedComponent,- Transformer
- Direct Known Subclasses:
- UnZipTransformer,- ZipTransformer
Base class for transformers that provide Zip compression.
- Since:
- 6.1
- Author:
- Gunnar Hillert, Artem Bilan
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected Charsetprotected booleanprotected FileNameGeneratorprotected Fileprotected ZipResultTypeFields inherited from class org.springframework.integration.context.IntegrationObjectSupportEXPRESSION_PARSER, logger
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected ObjectdoTransform(Message<?> message) Subclasses must implement this method to provide the transformation logic.protected abstract ObjectdoZipTransform(Message<?> message) Subclasses must implement this method to provide the Zip transformation logic.protected voidonInit()Subclasses may implement this for initialization logic.voidsetDeleteFiles(boolean deleteFiles) voidsetWorkDirectory(File workDirectory) Set the work-directory.voidsetZipResultType(ZipResultType zipResultType) Define the format of the data returned after transformation.Methods inherited from class org.springframework.integration.transformer.AbstractTransformertransformMethods inherited from class org.springframework.integration.context.IntegrationObjectSupportafterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getComponentType, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
- 
Field Details- 
charset
- 
fileNameGenerator
- 
zipResultType
- 
workDirectory
- 
deleteFilesprotected boolean deleteFiles
 
- 
- 
Constructor Details- 
AbstractZipTransformerpublic AbstractZipTransformer()
 
- 
- 
Method Details- 
setDeleteFiles
- 
setWorkDirectorySet the work-directory. The work directory is used when theZipResultTypeis set toZipResultType.FILE. By default, this property is set to the System temporary directory containing a subdirectory "ziptransformer".- Parameters:
- workDirectory- Must not be null and must not represent a file.
 
- 
setZipResultTypeDefine the format of the data returned after transformation. Available options are:- File
- Byte Array
 ZipResultType.FILE.- Parameters:
- zipResultType- Must not be null
 
- 
onInitprotected void onInit()Description copied from class:IntegrationObjectSupportSubclasses may implement this for initialization logic.- Overrides:
- onInitin class- IntegrationObjectSupport
 
- 
doTransformDescription copied from class:AbstractTransformerSubclasses 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:
- doTransformin class- AbstractTransformer
- Parameters:
- message- the message and its payload must not be null.
- Returns:
- The result of the transformation.
 
- 
doZipTransform
 
-