0 Replies Latest reply on May 9, 2016 10:51 AM by sam.sairlao

    Jetty - addAttachment and setAttachement

    sam.sairlao

      Hi,

       

      I recently learn to code Java & Camel and I struck on Jetty adding attachment to REST Get page.

       

      For Camel code; I want to http://0.0.0.0:9090/getFile and the REST client should download the file but some how it always download file with wrong filename.

       

      Can you guide to the right direction?

       

      Below are my Processor codes:

       

      public class addFileProcessor  implements Processor
      {


      public void process(Exchange exchange) throws Exception
      {
       
           File aFile= new File("c:\\temp\\testing.zip");

        
           exchange.getOut().setHeader(Exchange.CONTENT_TYPE, "application/zip");
           exchange.getOut().setBody(aFile);
      }

      }