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,ComponentSourceAware,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 Summary
FieldsModifier and TypeFieldDescriptionprotected Charsetprotected booleanprotected Fileprotected ZipResultTypeFields inherited from class org.springframework.integration.context.IntegrationObjectSupport
EXPRESSION_PARSER, logger -
Constructor Summary
Constructors -
Method Summary
Modifier 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.AbstractTransformer
transformMethods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentDescription, getComponentName, getComponentSource, getComponentType, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
-
Field Details
-
charset
-
zipResultType
-
workDirectory
-
deleteFiles
protected boolean deleteFiles
-
-
Constructor Details
-
AbstractZipTransformer
public AbstractZipTransformer()
-
-
Method Details
-
setDeleteFiles
-
setWorkDirectory
Set 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.
-
setZipResultType
Define the format of the data returned after transformation. Available options are:- File
- Byte Array
ZipResultType.FILE.- Parameters:
zipResultType- Must not be null
-
onInit
protected void onInit()Description copied from class:IntegrationObjectSupportSubclasses may implement this for initialization logic.- Overrides:
onInitin classIntegrationObjectSupport
-
doTransform
Description 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 classAbstractTransformer- Parameters:
message- the message and its payload must not be null.- Returns:
- The result of the transformation.
-
doZipTransform
-