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/03/31 00:10:26 UTC
DO NOT REPLY [Bug 28066] New: -
Error parsing NT FTP Listing when Server lists in Unix Format
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=28066>.
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=28066
Error parsing NT FTP Listing when Server lists in Unix Format
Summary: Error parsing NT FTP Listing when Server lists in Unix
Format
Product: Commons
Version: 1.1.0
Platform: All
OS/Version: All
Status: NEW
Severity: Enhancement
Priority: Other
Component: Net
AssignedTo: commons-dev@jakarta.apache.org
ReportedBy: gastao.woelfert@accenture.com
When listing file in an NT FTP Server, which is set to list in UNIX format,
there is a little problem with the UNIXFTPEntryParser regular expression.
For files created between 0:00 AM and 9:59 AM, the list returned from an UNIX
FTP Server and from a NT FTP Server (set to list in the UNIX format) diverge.
The hour in the UNIX System is always shown with to digits (00, 01, 02, ... 10,
11, 12, ... 23).
Nevertheless the hour in the NT System varies (0, 1, 2 ,... 10, 11, 12 , ...
23).
Example:
UNIX:
-rw-rw-r-- 1 mqm mqm 17707 Mar 12 03:33 killmq.sh.log
NT:
-rw-rw-r-- 1 mqm mqm 17707 Mar 12 3:33 killmq.sh.log
As the UNIXFTPEntryParser regular expression is not prepared to this kind of
listing, the program hangs, for some unknown reason.
I substituted the regular expression from
private static final String REGEX =
"([bcdlf-])"
+ "(((r|-)(w|-)(x|-))((r|-)(w|-)(x|-))((r|-)(w|-)(x|-)))\\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])):([012345]\\d))\\s"
+ "(\\S+)(\\s*.*)";
to
private static final String REGEX =
"([bcdlf-])"
+ "(((r|-)(w|-)(x|-))((r|-)(w|-)(x|-))((r|-)(w|-)(x|-)))\\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])|(?:[3-9])):([012345]\\d))
\\s"
+ "(\\S+)(\\s*.*)";
and it worked fine.
Best Regards,
Gastão
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org