[jira] Created: (CAMEL-1585) SFTP GenericFileProducer.createFileName produces OS normalized file name, that doesn't work with SFTP

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (CAMEL-1585) SFTP GenericFileProducer.createFileName produces OS normalized file name, that doesn't work with SFTP

JIRA jira@apache.org
SFTP GenericFileProducer.createFileName produces OS normalized file name, that doesn't work with SFTP
-----------------------------------------------------------------------------------------------------

                 Key: CAMEL-1585
                 URL: https://issues.apache.org/activemq/browse/CAMEL-1585
             Project: Apache Camel
          Issue Type: Bug
          Components: camel-ftp
    Affects Versions: 2.0-M1
         Environment: Windows XP
            Reporter: Darryl Smith


The use of File.separator and FileUtil.normalizePath in GenericFileProducer.createFileName produce a OS normalized file name, that doesn't work with SFTP

e.g. outbound\\out_20090501_091940_ACC.txt which will not work produce a file called outboundout_20090501_091940_ACC.txt

The proper name should be outbound/out_20090501_091940_ACC.txt

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

Reply | Threaded
Open this post in threaded view
|

[jira] Assigned: (CAMEL-1585) SFTP GenericFileProducer.createFileName produces OS normalized file name, that doesn't work with SFTP

JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-1585?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang reassigned CAMEL-1585:
-----------------------------------

    Assignee: Willem Jiang

> SFTP GenericFileProducer.createFileName produces OS normalized file name, that doesn't work with SFTP
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1585
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1585
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-ftp
>    Affects Versions: 2.0-M1
>         Environment: Windows XP
>            Reporter: Darryl Smith
>            Assignee: Willem Jiang
>
> The use of File.separator and FileUtil.normalizePath in GenericFileProducer.createFileName produce a OS normalized file name, that doesn't work with SFTP
> e.g. outbound\\out_20090501_091940_ACC.txt which will not work produce a file called outboundout_20090501_091940_ACC.txt
> The proper name should be outbound/out_20090501_091940_ACC.txt

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-1585) SFTP GenericFileProducer.createFileName produces OS normalized file name, that doesn't work with SFTP

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-1585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=51520#action_51520 ]

Claus Ibsen commented on CAMEL-1585:
------------------------------------

Willem. I guess we need an option on FTP endpoint to define the / or \ separator to use.
Unit testing with the mocked FTP server might not work on windows with the \ separator.

But for FTP the / is the proper separator, even on Windows :)


> SFTP GenericFileProducer.createFileName produces OS normalized file name, that doesn't work with SFTP
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1585
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1585
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-ftp
>    Affects Versions: 2.0-M1
>         Environment: Windows XP
>            Reporter: Darryl Smith
>            Assignee: Willem Jiang
>
> The use of File.separator and FileUtil.normalizePath in GenericFileProducer.createFileName produce a OS normalized file name, that doesn't work with SFTP
> e.g. outbound\\out_20090501_091940_ACC.txt which will not work produce a file called outboundout_20090501_091940_ACC.txt
> The proper name should be outbound/out_20090501_091940_ACC.txt

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-1585) SFTP GenericFileProducer.createFileName produces OS normalized file name, that doesn't work with SFTP

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-1585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=51522#action_51522 ]

Willem Jiang commented on CAMEL-1585:
-------------------------------------

@Claus,

Yes, I just checked the code, we do use the "/" as the separator for the remote file even on Windows.
Maybe I need run a unit test with a real ftp server.

> SFTP GenericFileProducer.createFileName produces OS normalized file name, that doesn't work with SFTP
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1585
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1585
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-ftp
>    Affects Versions: 2.0-M1
>         Environment: Windows XP
>            Reporter: Darryl Smith
>            Assignee: Willem Jiang
>
> The use of File.separator and FileUtil.normalizePath in GenericFileProducer.createFileName produce a OS normalized file name, that doesn't work with SFTP
> e.g. outbound\\out_20090501_091940_ACC.txt which will not work produce a file called outboundout_20090501_091940_ACC.txt
> The proper name should be outbound/out_20090501_091940_ACC.txt

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-1585) SFTP GenericFileProducer.createFileName produces OS normalized file name, that doesn't work with SFTP

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-1585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=51523#action_51523 ]

Willem Jiang commented on CAMEL-1585:
-------------------------------------

I found there are something wrong on the RemoteFileProducer side if GenericFileProducer uses the File.separator and FileUtil.normalizedPath.
Just wonder why the FTP unit test can't find this kind of error. I will dig the code for it.


> SFTP GenericFileProducer.createFileName produces OS normalized file name, that doesn't work with SFTP
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1585
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1585
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-ftp
>    Affects Versions: 2.0-M1
>         Environment: Windows XP
>            Reporter: Darryl Smith
>            Assignee: Willem Jiang
>
> The use of File.separator and FileUtil.normalizePath in GenericFileProducer.createFileName produce a OS normalized file name, that doesn't work with SFTP
> e.g. outbound\\out_20090501_091940_ACC.txt which will not work produce a file called outboundout_20090501_091940_ACC.txt
> The proper name should be outbound/out_20090501_091940_ACC.txt

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-1585) SFTP GenericFileProducer.createFileName produces OS normalized file name, that doesn't work with SFTP

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-1585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=51524#action_51524 ]

Claus Ibsen commented on CAMEL-1585:
------------------------------------

We have another Camel end user on 2.0m1 that uses SFTP on Windows.
The current code base works for him.

So I think we need that option to set to use either / or \ to cater for this.

> SFTP GenericFileProducer.createFileName produces OS normalized file name, that doesn't work with SFTP
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1585
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1585
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-ftp
>    Affects Versions: 2.0-M1
>         Environment: Windows XP
>            Reporter: Darryl Smith
>            Assignee: Willem Jiang
>
> The use of File.separator and FileUtil.normalizePath in GenericFileProducer.createFileName produce a OS normalized file name, that doesn't work with SFTP
> e.g. outbound\\out_20090501_091940_ACC.txt which will not work produce a file called outboundout_20090501_091940_ACC.txt
> The proper name should be outbound/out_20090501_091940_ACC.txt

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-1585) SFTP GenericFileProducer.createFileName produces OS normalized file name, that doesn't work with SFTP

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-1585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=51525#action_51525 ]

Willem Jiang commented on CAMEL-1585:
-------------------------------------


I did a quick fix for it  by overriding the GenericFileProducer's getFileSeparator and normalizedPath in RemoteFileProducer.
The tests look good, and we need the end user to verify it.

BTW, I checked the RemoteFileConsumer , it doen't have  the FileSeparator and normalizedPath issue.
So if the end user just use the RemoteFileConsumer to poll the file , everything will be fine.


> SFTP GenericFileProducer.createFileName produces OS normalized file name, that doesn't work with SFTP
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1585
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1585
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-ftp
>    Affects Versions: 2.0-M1
>         Environment: Windows XP
>            Reporter: Darryl Smith
>            Assignee: Willem Jiang
>
> The use of File.separator and FileUtil.normalizePath in GenericFileProducer.createFileName produce a OS normalized file name, that doesn't work with SFTP
> e.g. outbound\\out_20090501_091940_ACC.txt which will not work produce a file called outboundout_20090501_091940_ACC.txt
> The proper name should be outbound/out_20090501_091940_ACC.txt

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

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (CAMEL-1585) SFTP GenericFileProducer.createFileName produces OS normalized file name, that doesn't work with SFTP

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-1585?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang resolved CAMEL-1585.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0-M2

committed a quick fix for it
http://svn.apache.org/viewvc?rev=772071&view=rev

> SFTP GenericFileProducer.createFileName produces OS normalized file name, that doesn't work with SFTP
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1585
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1585
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-ftp
>    Affects Versions: 2.0-M1
>         Environment: Windows XP
>            Reporter: Darryl Smith
>            Assignee: Willem Jiang
>             Fix For: 2.0-M2
>
>
> The use of File.separator and FileUtil.normalizePath in GenericFileProducer.createFileName produce a OS normalized file name, that doesn't work with SFTP
> e.g. outbound\\out_20090501_091940_ACC.txt which will not work produce a file called outboundout_20090501_091940_ACC.txt
> The proper name should be outbound/out_20090501_091940_ACC.txt

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-1585) SFTP GenericFileProducer.createFileName produces OS normalized file name, that doesn't work with SFTP

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-1585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=51529#action_51529 ]

Claus Ibsen commented on CAMEL-1585:
------------------------------------

Willem, great work. Yeah looking at the patch it was just the producer side not using the getFileSeparator.


> SFTP GenericFileProducer.createFileName produces OS normalized file name, that doesn't work with SFTP
> -----------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1585
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1585
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-ftp
>    Affects Versions: 2.0-M1
>         Environment: Windows XP
>            Reporter: Darryl Smith
>            Assignee: Willem Jiang
>             Fix For: 2.0-M2
>
>
> The use of File.separator and FileUtil.normalizePath in GenericFileProducer.createFileName produce a OS normalized file name, that doesn't work with SFTP
> e.g. outbound\\out_20090501_091940_ACC.txt which will not work produce a file called outboundout_20090501_091940_ACC.txt
> The proper name should be outbound/out_20090501_091940_ACC.txt

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