Uploaded image for project: 'Commons Net'
  1. Commons Net
  2. NET-454

paths with spaces result in inaccurate file information

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 3.0.1, 3.1
    • None
    • FTP
    • Mac OS X 10.7.3, FTP server is Pure-FTPd on Linux CentOS 5

    Description

      Calling FTPClient.listFiles(String pathname) results in an inaccurate file list being returned. The following test illustrates the issue:

          @Test
          public void remoteListFilesFailure() throws Exception {
      
              FTPClient client = new FTPClient();
      
              client.connect(REMOTE_SERVER);
              client.enterLocalPassiveMode();
              client.login(REMOTE_USERNAME, REMOTE_PASSWORD);
              client.setFileType(FTP.BINARY_FILE_TYPE);
      
              int reply = client.getReplyCode();
              if (!FTPReply.isPositiveCompletion(reply)) {
                  client.disconnect();
                  log.error("FTP server refused connection. reply=" + reply);
              }
      
              FTPFile[] rootFiles = client.listFiles("78/1295213/0/476312ca9c653ffc6cc8fb6e1649dae6/ModComp PO # 1054.pdf");
              Assert.assertEquals(1, rootFiles.length); // <-- fails with rootFiles.length = 0
          }
      

      Attachments

        1. FTPClientTest.java
          5 kB
          Shane Witbeck

        Activity

          People

            Unassigned Unassigned
            digitalsanctum Shane Witbeck
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: