Hi

Ah you can use a custom comparator for the sort. See the _sorting
using comparator_ section at
http://camel.apache.org/file2

The sortBy=*.pdf;*.txt would not work as expected. We could possible
enhance this, so Camel will fallback on using a regular expression on
the file name, if you do not use any of the ${file} tokens.


On Tue, Nov 29, 2011 at 9:24 AM, Lars <[email protected]> wrote:
> Hi,
>
> I have the following route below which transfers pdf-files and txt-files
> from one directory to different directories at target system. I want to
> write the pdf-files to target system before txt-files.
> I tried to do this by using sortBy in property file.
> Like this:
> sftp.inbox=sftp://[email protected]:22/files?password=secret&sortBy=*.pdf;*.txt
>
> However, it seems that some of the pdf-files is written to target after the
> txt-file.
> Are there other configurations to use to achieve that txt-files will be
> written to target system after all pdf-files?
> I'm using Camel 2.8.2.
>
>
> <route id="inComingInvoiceRoute" routePolicyRef="incomingPolicy" >
>        <from uri="{{sftp.inbox}}" />
>        <choice>
>                <when>
>                        <language 
> language="simple">${header.CamelFileNameOnly} regex
> '^.*pdf$'</language>
>                        <to uri="{{file.imagedirectory}}" />
>                </when>
>                <when>
>                        <language 
> language="simple">${header.CamelFileNameOnly} regex
> '^.*txt$'</language>
>                        <to uri="{{file.outbox}}" />
>                </when>
>                <otherwise>
>                        <to uri="{{file.other}}" />
>                </otherwise>
>        </choice>
> </route>
>
>
> Thanks in advance for any hints.
>
> Best regards
> Lars Stuevold
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Writing-to-destination-where-priority-is-based-on-filename-extension-tp5031542p5031542.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: [email protected]
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to