commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sco...@apache.org
Subject svn commit: r190706 - in /jakarta/commons/proper/net/trunk/src: java/org/apache/commons/net/ftp/parser/NTFTPEntryParser.java test/org/apache/commons/net/ftp/parser/NTFTPEntryParserTest.java
Date Wed, 15 Jun 2005 04:17:06 GMT
Author: scohen
Date: Tue Jun 14 21:17:03 2005
New Revision: 190706

URL: http://svn.apache.org/viewcvs?rev=190706&view=rev
Log:
Fix defect 35346.  Patch submitted by Sergey Smimov

Modified:
    jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/NTFTPEntryParser.java
    jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/ftp/parser/NTFTPEntryParserTest.java

Modified: jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/NTFTPEntryParser.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/NTFTPEntryParser.java?rev=190706&r1=190705&r2=190706&view=diff
==============================================================================
--- jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/NTFTPEntryParser.java
(original)
+++ jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/NTFTPEntryParser.java
Tue Jun 14 21:17:03 2005
@@ -39,8 +39,7 @@
      */
     private static final String REGEX =
         "(\\S+)\\s+(\\S+)\\s+"
-        + "(<DIR>)?\\s*"
-        + "([0-9]+)?\\s+"
+        + "(?:(<DIR>)|([0-9]+))\\s+"
         + "(\\S.*)";
 
     /**

Modified: jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/ftp/parser/NTFTPEntryParserTest.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/ftp/parser/NTFTPEntryParserTest.java?rev=190706&r1=190705&r2=190706&view=diff
==============================================================================
--- jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/ftp/parser/NTFTPEntryParserTest.java
(original)
+++ jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/ftp/parser/NTFTPEntryParserTest.java
Tue Jun 14 21:17:03 2005
@@ -199,4 +199,14 @@
         FTPFile f = getParser().parseFTPEntry(directoryBeginningWithNumber);
         assertEquals("name", "123xyz", f.getName());
     }
+    
+    public void testDirectoryBeginningWithNumberFollowedBySpaces() throws Exception
+    {
+        FTPFile f = getParser().parseFTPEntry("12-03-96  06:38AM       <DIR>      
   123 xyz");
+        assertEquals("name", "123 xyz", f.getName());
+        f = getParser().parseFTPEntry("12-03-96  06:38AM       <DIR>          123 abc
xyz");
+        assertNotNull(f);
+        assertEquals("name", "123 abc xyz", f.getName());
+    }
+
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message