You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2004/10/06 13:28:38 UTC
DO NOT REPLY [Bug 31560] New: -
FTPClient.listFiles method returns null for some files
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