DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20345>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20345

Directory names starting with numbers parsed improperly with NTFTPEntryParser

           Summary: Directory names starting with numbers parsed improperly
                    with NTFTPEntryParser
           Product: Commons
           Version: 1.0 Final
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: Net
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


When connecting to a Microsoft FTP Service using MS-DOS directory listings if 
the directory starts with a number the directory name is parsed incorrectly 
when using the following:

  NTFTPEntryParser parser = new NTFTPEntryParser();
  FTPFile[] FTPFiles = ftp.listFiles(parser);

For example if the directory name is 2003-05-27 the FTPFile[i].getName() 
returns -05-27.

The issue is with the regexp in NTFTPEntryParser. For a quick fix I just
slightly modified the 8th group from "([0-9]+)?\\s*" to "([0-9]+)?\\s\\s*"
so the final regexp is as follows:

    private static final String REGEX =
        "((?:0[1-9])|(?:1[0-2]))-" 
        + "((?:0[1-9])|(?:[1-2]\\d)|(?:3[0-1]))-" 
        + "(\\d\\d)\\s*" 
        + "((?:0[1-9])|(?:1[012])):" 
        + "([0-5]\\d)\\s*" 
        + "([AP])M\\s*" 
        + "(<DIR>)?\\s*" 
        + "([0-9]+)?\\s\\s*"
        + "(\\S.*)";

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to