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 31560] New: - FTPClient.listFiles method returns null for some files
Date Wed, 06 Oct 2004 11:28:38 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=31560>.
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=31560

FTPClient.listFiles method returns null for some files

           Summary: FTPClient.listFiles method returns null for some files
           Product: Commons
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Net
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: mjandik@centrum.cz


There's problem in regullar expression in class 
org.apache.commons.net.ftp.parser.UnixFTPEntryParser which causes that files 
with lastmodified attribute from 0 to 1 a.m. are not listed by ftpclient 
listFiles method.

Example:
This file is listed correctly:
-rwxrwxrwx 1 owner group 5127 Sep 24 11:44 somefile_tst_200409192_v105_breq.xml
For this, listFiles method returns null:
-rwxrwxrwx 1 owner group 5127 Sep 20 0:32 somefile_tst_200409192_v101_breq.xml


Problem seems to be in:
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+"
+ "((\\d\\d\\d\\d)|((?:[01]\\d)|(?:2[0123])|(?:[1-9])):([012345]\\d))\\s+"
+ "(\\S+)(\\s*.*)";

where correct expression should be like this (0 insted of 1):

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+"
+ "((\\d\\d\\d\\d)|((?:[01]\\d)|(?:2[0123])|(?:[0-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