如何使用Apache Camel從zip文件中提取文件(一個或多個)?可能嗎?使用Apache Camel解壓縮文件?
我想這
from("file:/home/myinputzip?noop=true&delay=5000&moveFailed=error")
.split(new ZipSplitter())
.streaming().convertBodyTo(String.class)
.to("file:/home/myinputzip")
.end();
當我啓動應用程序,該文件是從解壓縮後,但駱駝拋出一個異常,並且文件被移動到文件夾錯誤:
ERROR: org.apache.camel.processor.DefaultErrorHandler - Failed delivery for (MessageId: ID-ubuntu-35217-1377806407437-0-5 on ExchangeId: ID-ubuntu-35217-1377806407437-0-7). Exhausted after delivery attempt: 1 caught: org.apache.camel.component.file.GenericFileOperationFailedException: Cannot write null body to file: /home/myinputzip/aVIII_crrpfp201304.cap org.apache.camel.component.file.GenericFileOperationFailedException: Cannot write null body to file: /home/myinputzip/aVIII_crrpfp201304.cap at org.apache.camel.component.file.FileOperations.storeFile(FileOperations.java:194) at org.apache.camel.component.file.GenericFileProducer.writeFile(GenericFileProducer.java:257) at org.apache.camel.component.file.GenericFileProducer.processExchange(GenericFileProducer.java:159) at org.apache.camel.component.file.GenericFileProducer.process(GenericFileProducer.java:80) at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:122) at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:298) at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:117)
誰能幫我?
這是與此相關的問題https://issues.apache.org/jira/browse/CAMEL-6679? – hveiga