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

paths with spaces result in inaccurate file information

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 3.0.1, 3.1
    • Fix Version/s: None
    • Component/s: FTP
    • Labels:
    • Environment:

      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

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              digitalsanctum Shane Witbeck

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment