Class UnZipTransformer
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.transformer.AbstractTransformer
org.springframework.integration.zip.transformer.AbstractZipTransformer
org.springframework.integration.zip.transformer.UnZipTransformer
- All Implemented Interfaces:
Aware, BeanFactoryAware, BeanNameAware, InitializingBean, ApplicationContextAware, ComponentSourceAware, ExpressionCapable, GenericTransformer<Message<?>, Message<?>>, NamedComponent, Transformer
Transformer implementation that applies an UnZip transformation to the message
payload.
- Since:
- 6.1
- Author:
- Gunnar Hillert, Artem Bilan, Ingo Dueppe, Ngoc Nhan, Glenn Renfro
-
Field Summary
Fields inherited from class AbstractZipTransformer
charset, deleteFiles, workDirectory, zipResultTypeFields inherited from class IntegrationObjectSupport
EXPRESSION_PARSER, logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectdoZipTransform(Message<?> message) Subclasses must implement this method to provide the Zip transformation logic.voidsetExpectSingleResult(boolean expectSingleResult) This parameter indicates that only one result object shall be returned as a result from the executed Unzip operation.voidsetMaxCompressionRatio(double maxCompressionRatio) Set the maximum allowed ratio of uncompressedSize / compressedSize.voidsetMaxEntryCount(int maxEntryCount) Set the maximum number of zip entries allowed within a single archive.voidsetMaxUncompressedSize(long maxUncompressedSize) Set the maximum allowed bytes for the cumulative total of all entries.Methods inherited from class AbstractZipTransformer
doTransform, onInit, setDeleteFiles, setWorkDirectory, setZipResultTypeMethods inherited from class AbstractTransformer
transformMethods inherited from class IntegrationObjectSupport
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
-
Constructor Details
-
UnZipTransformer
public UnZipTransformer()
-
-
Method Details
-
setMaxUncompressedSize
public void setMaxUncompressedSize(long maxUncompressedSize) Set the maximum allowed bytes for the cumulative total of all entries.- Parameters:
maxUncompressedSize- the maximum uncompressed size. Default is 100MB- Since:
- 6.4.13
-
setMaxEntryCount
public void setMaxEntryCount(int maxEntryCount) Set the maximum number of zip entries allowed within a single archive. Default is 1000. Setting to0disables the check.- Parameters:
maxEntryCount- the maximum entry count- Since:
- 6.4.13
-
setMaxCompressionRatio
public void setMaxCompressionRatio(double maxCompressionRatio) Set the maximum allowed ratio of uncompressedSize / compressedSize. Default is 100. Setting to0disables the check.- Parameters:
maxCompressionRatio- the maximum compression ratio- Since:
- 6.4.13
-
setExpectSingleResult
public void setExpectSingleResult(boolean expectSingleResult) This parameter indicates that only one result object shall be returned as a result from the executed Unzip operation. If set totrueand more than 1 element is returned, then that 1 element is extracted and returned as payload. If the result map contains more than 1 element andexpectSingleResultistrue, then aMessagingExceptionis thrown. If set tofalse, the complete result list is returned as the payload. This is thedefault.- Parameters:
expectSingleResult- If not set explicitly, will default to false
-
getComponentType
-
doZipTransform
Description copied from class:AbstractZipTransformerSubclasses must implement this method to provide the Zip transformation logic.- Specified by:
doZipTransformin classAbstractZipTransformer- Parameters:
message- The message will never be null.- Returns:
- The result of the Zip transformation.
-