RAW is intended for passwords etc.

The file component is for consuming files, and if you want to pickup
specific files, then use the filter options.
You can implement a filter where you can match the file with space
etc. Or use one of the filters that uses reg exp style where you can
specific a pattern that matches your file.



On Tue, Mar 28, 2017 at 4:23 PM, [email protected]
<[email protected]> wrote:
> Hi,
>
> given the following URI (/note the blank in the file name/):
>
> sftp://...../foo?fileName=RAW(bla .zip)
>
> and the following code will break, i.e. will not download the file as
> expected
>
> public Exchange receive(final String uri) {
>         final Endpoint endpoint =
> consumerTemplate.getCamelContext().getEndpoint(uri);
>         ...
>         return consumerTemplate.receive(*endpoint*);
> }
>
> whereas the following code works as expected:
>
> public Exchange receive(final String uri) {
>         final Endpoint endpoint =
> consumerTemplate.getCamelContext().getEndpoint(uri);
>         ...
>         return consumerTemplate.receive(*uri*);
> }
>
> through heavy debugging we found the reason:
>
> The getEndpoint() call will cause the URI to be escaped as
> ...&fileName=RAW(bla%20.zip).
> OK so far.
>
> Yet within the receive() method the URI is escaped a *second* time!
> This causes the final URI to read as ...&fileName=RAW(bla%2520.zip), i.e.
> the % sign is escaped, too.
>
> The download then fails of course...
>
> I' d regard this as a bug in Camel... (Tested with 2.16.3 and 2.18.3)
>
> Cheers
>     Markus
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Bug-in-RAW-URI-encoding-of-endpoint-tp5796603.html
> Sent from the Camel Development mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to