Issue Details (XML | Word | Printable)

Key: NET-6
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Martin Jandík
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons Net

FTPClient.listFiles method returns null for some files

Created: 06/Oct/04 06:28 PM   Updated: 20/Sep/07 05:31 AM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Environment:
Operating System: Windows XP
Platform: PC

Bugzilla Id: 31560


 Description  « Hide
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*.*)";



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Henri Yandell made changes - 16/May/06 09:46 AM
Field Original Value New Value
issue.field.bugzillaimportkey 31560 12341781
Henri Yandell made changes - 16/May/06 11:48 AM
Affects Version/s unspecified [ 12311647 ]
Project Commons [ 12310458 ] Commons Net [ 12310487 ]
Component/s Net [ 12311127 ]
Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
Key COM-1629 NET-6
Henri Yandell made changes - 20/Sep/07 05:31 AM
Status Resolved [ 5 ] Closed [ 6 ]