Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 13701 invoked from network); 13 Jun 2005 17:55:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Jun 2005 17:55:10 -0000 Received: (qmail 64006 invoked by uid 500); 13 Jun 2005 17:55:05 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 63932 invoked by uid 500); 13 Jun 2005 17:55:05 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 63918 invoked by uid 99); 13 Jun 2005 17:55:04 -0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from ajax-1.apache.org (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 13 Jun 2005 10:55:03 -0700 Received: by ajax.apache.org (Postfix, from userid 99) id 2AC66102; Mon, 13 Jun 2005 19:29:53 +0200 (CEST) From: bugzilla@apache.org To: commons-dev@jakarta.apache.org Subject: DO NOT REPLY [Bug 35346] New: - NTFTPEntryParser parses directory names starting with a number followed by space incorrectly. X-Bugzilla-Reason: AssignedTo Message-Id: <20050613172953.2AC66102@ajax.apache.org> Date: Mon, 13 Jun 2005 19:29:53 +0200 (CEST) X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG� RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . 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=35346 Summary: NTFTPEntryParser parses directory names starting with a number followed by space incorrectly. Product: Commons Version: 1.4 Final Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: Net AssignedTo: commons-dev@jakarta.apache.org ReportedBy: gecko@yandex.ru When I used FTPClient.listFiles() with MS FTP Server I found that directories with names starting with a number followed by space being parsed incorrectly. But when I browse above-mentioned server with Internet Explorer or with Total Commander�s built-in ftp client directory names are shown correctly. Now look at the following failing test. (It should be added to NTFTPEntryParserTest class): public void testDirectoryBeginningWithNumberFollowedBySpaces() throws Exception { FTPFile f = getParser().parseFTPEntry("12-03-96 06:38AM 123 xyz"); assertEquals("name", "123 xyz", f.getName()); } Junit output: � [junit] name expected:<123 ...> but was:<...> [junit] junit.framework.ComparisonFailure: name expected:<123 ...> but was:<...> � The following patch fixes the problem: Index: jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/NTFTPEntryParser.java =============================================================== ==== RCS file: /home/cvspublic/jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/ NTFTPEntryParser.java,v retrieving revision 1.19 diff -u -r1.19 NTFTPEntryParser.java --- jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/NTFTPEntryParser.java 2 Jan 2005 03:17:50 -0000 1.19 +++ jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/NTFTPEntryParser.java 13 Jun 2005 17:26:16 -0000 @@ -39,8 +39,7 @@ */ private static final String REGEX = "(\\S+)\\s+(\\S+)\\s+" - + "()?\\s*" - + "([0-9]+)?\\s+" + + "(?:()|([0-9]+))\\s+" + "(\\S.*)"; /** -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org