title: Unzip files with Apache Camel?
body: <p>How I can extract files (one or more than one) from a zip file with Apache Camel? Is it possible?</p>
  
  <p>I'm trying this</p>
  
  <pre><code>from("file:/home/myinputzip?noop=true&amp;delay=5000&amp;moveFailed=error")
    .split(new ZipSplitter())
      .streaming().convertBodyTo(String.class)      
    .to("file:/home/myinputzip")
  .end();
  </code></pre>
  
  <p>When I start the application, the file is extracted from zip, but camel throws an exception and the file is moved to error folder:</p>
  
  <blockquote>
    <p>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)</p>
  </blockquote>
  
  <p>Can anyone help me?</p>