Spring Integration
  1. Spring Integration
  2. INT-2476

ftp outbound gateway fails on files with spaces

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.1 GA
    • Fix Version/s: 2.1.1, 2.2 M1
    • Component/s: FTP/SFTP Support
    • Labels:
    • Environment:
      Mac client, Linux Server

      Description

      no files are returned if they contain spaces. more info in the referenced forum post

      1. AttachmentIndexerHandlerTest.java
        4 kB
        Shane Witbeck
      2. FTPClientTest.java
        3 kB
        Shane Witbeck

        Activity

        Hide
        Shane Witbeck added a comment -

        More information:

        My workstation/client is Mac OS X 10.7.3. Server is CentOS 5 Linux using Pure-FTPd for the FTP server.

        Last night I did some more work to reproduce. I used an embedded FTP server and set up a test to exercise the failing code. This local test actually works and there's no issue with downloading a file with spaces! I'm attaching the test code I'm using.

        Show
        Shane Witbeck added a comment - More information: My workstation/client is Mac OS X 10.7.3. Server is CentOS 5 Linux using Pure-FTPd for the FTP server. Last night I did some more work to reproduce. I used an embedded FTP server and set up a test to exercise the failing code. This local test actually works and there's no issue with downloading a file with spaces! I'm attaching the test code I'm using.
        Hide
        Shane Witbeck added a comment -

        Used to exercise failing FTP downloads

        Show
        Shane Witbeck added a comment - Used to exercise failing FTP downloads
        Hide
        Shane Witbeck added a comment -

        OK, after further investigation this is definitely an issue with the commons-net FTPClient.listFiles method which is called from the FTPFile[] list(String path) method in SI's FtpSession class. Although I'm not able to reproduce locally it seems the directory listing parser fails (for certain ftp servers?). For the same server in question in my case, if I first change the working directory then call listFiles(".") I get the correct list of files back. I'm attaching another test which illustrates this. There's also evidence that spaces have been a pain point for commons-net in the past:

        https://issues.apache.org/jira/browse/NET-87

        https://issues.apache.org/jira/browse/NET-144

        https://issues.apache.org/jira/browse/NET-266

        Given all of this, is there an easy way to swap FTP clients or override the FtpSession.list method in SI?

        Show
        Shane Witbeck added a comment - OK, after further investigation this is definitely an issue with the commons-net FTPClient.listFiles method which is called from the FTPFile[] list(String path) method in SI's FtpSession class. Although I'm not able to reproduce locally it seems the directory listing parser fails (for certain ftp servers?). For the same server in question in my case, if I first change the working directory then call listFiles(".") I get the correct list of files back. I'm attaching another test which illustrates this. There's also evidence that spaces have been a pain point for commons-net in the past: https://issues.apache.org/jira/browse/NET-87 https://issues.apache.org/jira/browse/NET-144 https://issues.apache.org/jira/browse/NET-266 Given all of this, is there an easy way to swap FTP clients or override the FtpSession.list method in SI?
        Hide
        Oleg Zhurakousky added a comment -

        Shane

        What FTP client did you have in mind? I'd love to change it to something more stable.

        Show
        Oleg Zhurakousky added a comment - Shane What FTP client did you have in mind? I'd love to change it to something more stable.
        Hide
        Shane Witbeck added a comment -

        This is looking more like an issue with the specific FTP server I'm using which doesn't handle spaces in the filenames gracefully. I've also confirmed the same behavior using the command-line FTP client on Mac OS X.

        I've also opened an issue with Commons-Net (https://issues.apache.org/jira/browse/NET-454) to get feedback from them regarding a good workaround.

        Show
        Shane Witbeck added a comment - This is looking more like an issue with the specific FTP server I'm using which doesn't handle spaces in the filenames gracefully. I've also confirmed the same behavior using the command-line FTP client on Mac OS X. I've also opened an issue with Commons-Net ( https://issues.apache.org/jira/browse/NET-454 ) to get feedback from them regarding a good workaround.
        Hide
        Oleg Zhurakousky added a comment -

        Cool, than the best thing to do at this point is document (here n JIRA) your findings, link it to https://issues.apache.org/jira/browse/NET-454 and resolve it as "Won't Fix".
        Also, if you feel that its worth mentioning in the documentation, than I'd still resolve it as described above and open a new Documentation issue and link them together

        Show
        Oleg Zhurakousky added a comment - Cool, than the best thing to do at this point is document (here n JIRA) your findings, link it to https://issues.apache.org/jira/browse/NET-454 and resolve it as "Won't Fix". Also, if you feel that its worth mentioning in the documentation, than I'd still resolve it as described above and open a new Documentation issue and link them together
        Hide
        Shane Witbeck added a comment -

        This turned out to be a problem specific to the Pure-FTPd server. More information regarding the resolution can be found in a related Commons-Net JIRA (https://issues.apache.org/jira/browse/NET-454).

        I do think that this issue may be worth mentioning in the documentation and I will open a separate JIRA issue for that.

        Show
        Shane Witbeck added a comment - This turned out to be a problem specific to the Pure-FTPd server. More information regarding the resolution can be found in a related Commons-Net JIRA ( https://issues.apache.org/jira/browse/NET-454 ). I do think that this issue may be worth mentioning in the documentation and I will open a separate JIRA issue for that.

          People

          • Assignee:
            Shane Witbeck
            Reporter:
            Shane Witbeck
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: