commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sco...@apache.org
Subject svn commit: r377587 - in /jakarta/commons/proper/net/trunk/src: java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java test/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java
Date Tue, 14 Feb 2006 02:48:44 GMT
Author: scohen
Date: Mon Feb 13 18:48:43 2006
New Revision: 377587

URL: http://svn.apache.org/viewcvs?rev=377587&view=rev
Log:
Patch by David D. Kilzer.  bug 38634.  Fix problem with group names with spaces in them
(allowed by Windows, and therefore Cygwin).

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

Modified: jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java?rev=377587&r1=377586&r2=377587&view=diff
==============================================================================
--- jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java
(original)
+++ jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java
Mon Feb 13 18:48:43 2006
@@ -89,7 +89,7 @@
         +"(((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-])))\\+?\\s+"
         + "(\\d+)\\s+"
         + "(\\S+)\\s+"
-        + "(?:(\\S+)\\s+)?"
+        + "(?:(\\S+(?:\\s\\S+)*)\\s+)?"
         + "(\\d+)\\s+"
         
         /*

Modified: jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java?rev=377587&r1=377586&r2=377587&view=diff
==============================================================================
--- jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java
(original)
+++ jakarta/commons/proper/net/trunk/src/test/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java
Mon Feb 13 18:48:43 2006
@@ -36,7 +36,7 @@
 			"drwxr-xr-x   2 root     root         4096 Aug 36  2001 zztpp",
 			"-rw-r--r--   1 14       staff       80284 Aug 22  zxJDBC-1.2.3.tar.gz",
 			"-rw-r--r--   1 14       staff      119:26 Aug 22  2000 zxJDBC-1.2.3.zip",
-			"-rw-r--r--   1 ftp      no group    83853 Jan 22  2001 zxJDBC-1.2.4.tar.gz",
+			/*"-rw-r--r--   1 ftp      no group    83853 Jan 22  2001 zxJDBC-1.2.4.tar.gz",*/
 			"-rw-r--r--   1ftp       nogroup    126552 Jan 22  2001 zxJDBC-1.2.4.zip",
 			"-rw-r--r--   1 root     root       190144 2001-04-27 zxJDBC-2.0.1b1.zip",
 			"-rw-r--r--   1 root     root       111325 Apr -7 18:79 zxJDBC-2.0.1b1.tar.gz" };
@@ -70,7 +70,9 @@
 			"-rwsr-sr--   1 500      500             0 Mar 25 0:23 testSuidExec2",
 			"drwxrwx---+ 23 500     500    0 Jan 10 13:09 testACL",
 			"-rw-r--r--   1 1        3518644 May 25 12:12 std",
-            "lrwxrwxrwx   1 neeme neeme             23 Mar  2 18:06 macros -> ./../../global/macros/."
+            "lrwxrwxrwx   1 neeme neeme             23 Mar  2 18:06 macros -> ./../../global/macros/.",
+			"-rw-r--r--   1 ftp      group with spaces in it as allowed in cygwin see bug 38634  
83853 Jan 22  2001 zxJDBC-1.2.4.tar.gz"
+
 
 		};
 
@@ -202,13 +204,13 @@
 	public void testParseFieldsOnFile() throws Exception {
 		FTPFile f = getParser()
 				.parseFTPEntry(
-						"-rwxr-xr-x   2 user     group         5000000000 Mar  2 15:13 zxbox");
+						"-rwxr-xr-x   2 user     my group 500        5000000000 Mar  2 15:13 zxbox");
 		assertNotNull("Could not parse entry.", f);
 		assertTrue("Should have been a file.", f.isFile());
 		checkPermissions(f);
 		assertEquals(2, f.getHardLinkCount());
 		assertEquals("user", f.getUser());
-		assertEquals("group", f.getGroup());
+		assertEquals("my group 500", f.getGroup());
 		assertEquals("zxbox", f.getName());
 		assertEquals(5000000000L, f.getSize());
 



---------------------------------------------------------------------
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