camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "s.marjanovic" <slavisa.marjanovic...@gmail.com>
Subject How to get the file name from an http post submitted to jetty endpoint ?
Date Wed, 02 Sep 2015 12:01:27 GMT
Hello,

I'm creating a route that is supposed the accept an HTTP POST with a file
and, among other things, archive that file. My route is as shown below:

    from("jetty:http://{{host}}?httpMethodRestrict=POST").routeId("MyRoute")
         .to("file:"+"{{localArchiveFile}}")
         .unmarshal().zipFile()
         .convertBodyTo(String.class)
         .inOnly("amq:queue:MyQueue?timeToLive={{timetolive}}");

Stream cache is enabled on camel context level.

The problem I have is that file gets archived as something like ".134216472"
(a dot plus current system time).

Here's the filename pattern for inspection:
/data/archive/?fileName=${date:now:yyyyMMdd}/${file:onlyname}.${date:now:HHmmssSSS}

I'd like to avoid this and save the file with it's original name with
appended timestamp. I have inspected the exchange in debugger but I don't
see the filename in in.headers or in.request. Is there a way that I'm
missing that would enable me to get to the filename?

Kind regards,
Slavisa Marjanovic






--
View this message in context: http://camel.465427.n5.nabble.com/How-to-get-the-file-name-from-an-http-post-submitted-to-jetty-endpoint-tp5771156.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message