В karaf
bundle:install mvn:org.apache.camel/camel-zipfile/2.16.5
В pom.xml
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-zipfile</artifactId>
<version>2.16.5</version>
<!-- use the same version as your Camel core version -->
</dependency>
Упаковать файл:
from("file:camel/input")
.log(LoggingLevel.INFO, "Moving ${file:name} to the output directory")
.marshal().zipFile()
.to("file:camel/output")
.end();
Распаковать файл:
from("file:camel/input")
.log(LoggingLevel.INFO, "Moving ${file:name} to the output directory")
.unmarshal().zipFile()
.to("file:camel/output")
.end();
Если файл большой, то надо распаковывать:
from("file:camel/input")
.log(LoggingLevel.INFO, "Moving ${file:name} to the output directory")
.split(new ZipSplitter()).streaming()
.to("file:camel/output")
.end();