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 2003/05/30 04:19:43 UTC
DO NOT REPLY [Bug 20345] New: -
Directory names starting with numbers parsed improperly with NTFTPEntryParser
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20345>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20345
Directory names starting with numbers parsed improperly with NTFTPEntryParser
Summary: Directory names starting with numbers parsed improperly
with NTFTPEntryParser
Product: Commons
Version: 1.0 Final
Platform: All
OS/Version: All
Status: NEW
Severity: Minor
Priority: Other
Component: Net
AssignedTo: commons-dev@jakarta.apache.org
ReportedBy: kevin.g.flynn@tfn.com
When connecting to a Microsoft FTP Service using MS-DOS directory listings if
the directory starts with a number the directory name is parsed incorrectly
when using the following:
NTFTPEntryParser parser = new NTFTPEntryParser();
FTPFile[] FTPFiles = ftp.listFiles(parser);
For example if the directory name is 2003-05-27 the FTPFile[i].getName()
returns -05-27.
The issue is with the regexp in NTFTPEntryParser. For a quick fix I just
slightly modified the 8th group from "([0-9]+)?\\s*" to "([0-9]+)?\\s\\s*"
so the final regexp is as follows:
private static final String REGEX =
"((?:0[1-9])|(?:1[0-2]))-"
+ "((?:0[1-9])|(?:[1-2]\\d)|(?:3[0-1]))-"
+ "(\\d\\d)\\s*"
+ "((?:0[1-9])|(?:1[012])):"
+ "([0-5]\\d)\\s*"
+ "([AP])M\\s*"
+ "(<DIR>)?\\s*"
+ "([0-9]+)?\\s\\s*"
+ "(\\S.*)";
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org