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 Mon, 09 Mar 2009 07:03:40 GMT


Claus Ibsen commented on CAMEL-1428:

Ahh yeah bloddy world with either / or \ as path separators. 

I have changed the logic in Camel to rely more on the JDK to compute file paths for me, instead
of me build them self using strings.
So the problem manifests when you use Windows that uses \ separators with a FTP protocol that
uses /.

This one: Deleteing file: /\temp\incoming\.done/file.txt
Will just be ignored if it cannot delete it.

But the dir path is correct FTP path: \temp\incoming\.done
I suspect I wont like the leading separator = \

I will look into it and commit a fix in approx 1h or less.

> 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