Class ZipTransformer
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.transformer.AbstractTransformer
org.springframework.integration.zip.transformer.AbstractZipTransformer
org.springframework.integration.zip.transformer.ZipTransformer
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,BeanNameAware
,InitializingBean
,ApplicationContextAware
,ExpressionCapable
,GenericTransformer<Message<?>,
,Message<?>> NamedComponent
,Transformer
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:
If you want to generate Zip files larger than 4GB
, you must use Java 7:
- Since:
- 6.1
- Author:
- Gunnar Hillert, Artem Bilan
-
Field Summary
Fields inherited from class org.springframework.integration.zip.transformer.AbstractZipTransformer
charset, deleteFiles, fileNameGenerator, workDirectory, zipResultType
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
EXPRESSION_PARSER, logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Object
doZipTransform
(Message<?> message) void
setCompressionLevel
(int compressionLevel) Set the compression level.void
setUseFileAttributes
(boolean useFileAttributes) Specify whether the name of the file shall be used for the zip entry.Methods inherited from class org.springframework.integration.zip.transformer.AbstractZipTransformer
doTransform, onInit, setDeleteFiles, setWorkDirectory, setZipResultType
Methods inherited from class org.springframework.integration.transformer.AbstractTransformer
transform
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getComponentType, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
-
Constructor Details
-
ZipTransformer
public ZipTransformer()
-
-
Method Details
-
setCompressionLevel
public void setCompressionLevel(int compressionLevel) Set the compression level. Default isDeflater.DEFAULT_COMPRESSION
.- Parameters:
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.- Parameters:
useFileAttributes
- Defaults to true if not set explicitly
-
doZipTransform
The payload may encompass the following types: When providing anIterable
, nested Iterables are not supported. However, payloads can be any of the other supported types.- Specified by:
doZipTransform
in classAbstractZipTransformer
- Parameters:
message
- The message will never be null.- Returns:
- The result of the Zip transformation.
-