camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <>
Subject [jira] Commented: (CAMEL-1428) SftpConsumer : GenericFileRenameProcessStrategy - String index out of bounds
Date Sat, 07 Mar 2009 14:55:39 GMT


Claus Ibsen commented on CAMEL-1428:


About the placement of the .done folder. You should use the full power of the file language
to put together an expression that solves your needs.

So if you want to place the file in a .done subfolder in the *same* folder it was consumed
from, then you need to combine the ${file:parent} and ${file:name} such as:

I have reworked the code a bit as ${file:name} should always only return the name (no directories)
etc. as it should mimmic the corresponding method.
See the file language wiki page for more.

Using just .done/${file:name} will place it in  the root as Camel uses absolute names when
it performs FTP operations. The reason is that it does a double pass, first find files to
consume and then in the 2nd pass process them. This allows Camel to pickup the total number
of files, for people that need to rely on batch processing where the want to know the current
index and when the are no more files.

> SftpConsumer : GenericFileRenameProcessStrategy - String index out of bounds
> ----------------------------------------------------------------------------
>                 Key: CAMEL-1428
>                 URL:
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-ftp
>    Affects Versions: 2.0.0
>         Environment: Windows XP
>            Reporter: Paddy Daly
>            Assignee: Claus Ibsen
>             Fix For: 2.0-M1
>         Attachments: camel-error.txt, camel-error2.txt, camel-error3.txt, camel-error4.txt
> While trying to consume a file via SFTP and using the moveExpression to move the file
into a done folder a renameException is thrown.
> In GenericFile the relativeFileName reads something like the following.   /incoming/test/file1.txt
> When it tries to call this code and exception is thrown because File.separator is '\'
in a windows environment.
> String relative = relativeFileName.substring(0, relativeFileName.lastIndexOf(File.separator));

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message