This Spring Integration Extension provides Zip (un-) compression support. The following components are provided:
- Zip Transformer
- UnZip Transformer
- UnZip Result Splitter
The following input data types can be compressed:
- File
- String
- byte[]
- Iterable
In input data types can be mixed as part of an Iterable. E.g. you should be easily able to compress a collection containing Strings, byte arrays and Files. It is important to note that nested Iterables are NOT SUPPORTED at present time.
The zip transformer can be customized by setting several properties:
Sets the compression level. Default is Deflater#DEFAULT_COMPRESSION
Specifies whether the name of the file shall be used for the zip entry.
The following input data types can be decompressed:
- File
- InputStream
- byte[]
When unzipping data, you can also specify a property expectSingleResult. If set to true and more than 1 zip entry were detected, a MessagingException will be raised. This property also influences the return type of the payload. If set to false (the default), then the payload will be of type SortedMap, if true, however, the actual zip entry will be returned.
Othe properties that can be set on the UnZipTransformer:
If the payload is an instance of File
, this property specifies whether to delete the File after transformation. Default is false.
Set the work-directory. The work directory is used when the ZipResultType is set to ZipResultType.FILE. By default this property is set to the System temporary directory containing a sub-directory "ziptransformer".
Defines the format of the data returned after transformation. Available options are:
- File
- byte[]
The UnZipResultSplitter
is useful in cases where Zip files contain more than 1
zip entry.
TBD
The base package org.springframework.integration.zip
contains the ZipHeaders class which defines the Spring Integration message headers that are specific to the Zip module.
This package contains the parser classes for the XML Namespace support.
Contain the classes responsible for the actual (un-) zip operation:
- ZipTransformer
- UnZipTransformer
Full XML namespace support is provided.
To build and install jars into your local Maven cache, please execute:
./gradlew install
If you encounter out of memory errors during the build, increase available heap and permgen for Gradle:
GRADLE_OPTS='-XX:MaxPermSize=1024m -Xmx1024m'
To build api Javadoc (results will be in build/api
):
./gradlew api
To build complete distribution including -dist
and -schema
zip files (results will be in build/distributions
)
./gradlew dist
While your custom Spring Integration Adapter is initially created with SpringSource Tool Suite, you in fact end up with a Gradle-based project. As such, the created project can be imported into other IDEs as well.
Gradle projects can be directly imported into STS. But please make sure that you have the Gradle support installed.
To generate Eclipse metadata (.classpath and .project files), do the following:
./gradlew eclipse
Once complete, you may then import the project into Eclipse as usual:
File -> Import -> Existing projects into workspace
Browse to the root directory of the project and it should import free of errors.
To generate IDEA metadata (.iml and .ipr files), do the following:
./gradlew idea
Check out the spring-integration tag on Stack Overflow.
- Spring Integration
- Spring Integration Samples
- Spring Integration Templates
- Spring Integration Java DSL
- Spring Integration Dsl Groovy
- Spring Integration Dsl Scala
For more information, please also don't forget to visit the Spring Integration website.