commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 30737] New: - UnixFTPEntryParser returns null when timestamp is between 12:00am and 12:59am
Date Wed, 18 Aug 2004 20:56:32 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30737>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30737

UnixFTPEntryParser returns null when timestamp is between 12:00am and 12:59am

           Summary: UnixFTPEntryParser returns null when timestamp is
                    between 12:00am and 12:59am
           Product: Commons
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Net
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: k_flynn@yahoo.com


This concerns commons.net version 1.2.2.

When I request a ftp listing from a directory with a file having a timestamp 
between 12:00am and 12:59am on a Microsoft FTP Service (Version 5.0) box, the 
FTPClient listFiles() method returns null for that file.  Here is an example 
directory listing:

-rwxrwxrwx   1 owner    group       115407014 Aug 12 19:33 images_20040812.zip
-rwxrwxrwx   1 owner    group       144408943 Aug 13  2:03 images_20040813.zip
-rwxrwxrwx   1 owner    group       146215270 Aug 14 10:29 images_20040814.zip
-rwxrwxrwx   1 owner    group       144822990 Aug 17  6:00 images_20040817.zip
-rwxrwxrwx   1 owner    group              22 Aug 18  0:36 test.zip

The entry from listFiles() that corresponding text.zip will be null.

I tracked down the problem to the REGEX pattern in UnixFTPEntryParser.  If I 
change the expression to the following, I can get the FTPFile from the 
listFiles() method.

private static final String REGEX =
"([bcdlfmpSs-])"
+ "(((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-])))\\s+"
+ "(\\d+)\\s+"
+ "(\\S+)\\s+"
+ "(?:(\\S+)\\s+)?"
+ "(\\d+)\\s+"
+ MONTHS + "\\s+"
+ "((?:[0-9])|(?:[0-2][0-9])|(?:3[0-1]))\\s+"
// Following line changed
+ "((\\d\\d\\d\\d)|((?:[01]\\d)|(?:2[0123])|(?:[0-9])):([012345]\\d))\\s+"
// Original line
//+ "((\\d\\d\\d\\d)|((?:[01]\\d)|(?:2[0123])|(?:[1-9])):([012345]\\d))\\s+"
+ "(\\S+)(\\s*.*)";

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message