public class ZipTransformer extends AbstractZipTransformer
Transformer implementation that applies a Zip transformation to the
message payload. Keep in mind that Zip entry timestamps are recorded only to
two 2 second precision:
See also: http://mindprod.com/jgloss/zip.html
If you want to generate Zip files larger than 4GB, you must use Java 7:
See also: https://blogs.oracle.com/xuemingshen/entry/zip64_support_for_4g_zipfilecharset, deleteFiles, fileNameGenerator, workDirectory, zipResultType| Constructor and Description |
|---|
ZipTransformer() |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Object |
doZipTransform(org.springframework.messaging.Message<?> message)
The payload may encompass the following types:
File
...String
...byte[]
...Iterable
When providing an Iterable, nested Iterables are not supported. |
void |
setCompressionLevel(int compressionLevel)
Sets the compression level.
|
void |
setUseFileAttributes(boolean useFileAttributes)
Specifies whether the name of the file shall be used for the
zip entry.
|
doTransform, onInit, setDeleteFiles, setWorkDirectory, setZipResultTypetransformafterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getComponentType, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringpublic void setCompressionLevel(int compressionLevel)
Deflater.DEFAULT_COMPRESSION.compressionLevel - Must be an integer value from 0-9.public void setUseFileAttributes(boolean useFileAttributes)
useFileAttributes - Defaults to true if not set explicitlyprotected java.lang.Object doZipTransform(org.springframework.messaging.Message<?> message)
throws java.lang.Exception
File
...String
...Iterable
Iterable, nested Iterables are not supported. However,
payloads can be of of any of the other supported types.doZipTransform in class AbstractZipTransformermessage - The message will never be null.java.lang.Exception - Any exception.