commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwins...@apache.org
Subject svn commit: r756220 - in /commons/proper/net/branches/NET_2_0/src: main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java site/xdoc/changes.xml test/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java
Date Thu, 19 Mar 2009 21:36:02 GMT
Author: rwinston
Date: Thu Mar 19 21:36:02 2009
New Revision: 756220

URL: http://svn.apache.org/viewvc?rev=756220&view=rev
Log:
NET-259: Add fix for files with no spaces before the hard link count

Modified:
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java
    commons/proper/net/branches/NET_2_0/src/site/xdoc/changes.xml
    commons/proper/net/branches/NET_2_0/src/test/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java?rev=756220&r1=756219&r2=756220&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java
Thu Mar 19 21:36:02 2009
@@ -83,7 +83,7 @@
      */
     private static final String REGEX =
         "([bcdelfmpSs-])"
-        +"(((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-])))\\+?\\s+"
+        +"(((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-]))((r|-)(w|-)([xsStTL-])))\\+?\\s*"
         + "(\\d+)\\s+"
         + "(?:(\\S+(?:\\s\\S+)*?)\\s+)?"                // owner name (optional spaces)
         + "(?:(\\S+(?:\\s\\S+)*)\\s+)?"                 // group name (optional spaces)

Modified: commons/proper/net/branches/NET_2_0/src/site/xdoc/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/site/xdoc/changes.xml?rev=756220&r1=756219&r2=756220&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/site/xdoc/changes.xml (original)
+++ commons/proper/net/branches/NET_2_0/src/site/xdoc/changes.xml Thu Mar 19 21:36:02 2009
@@ -23,7 +23,7 @@
 	
 
 	<body>
-		<release version="2.0" date="" description="Java 5.0 release">
+		<release version="2.0" date="October 20, 2008" description="Java 5.0 release">
 			<action dev="rwinston" type="update">
 				Add null check in TelnetClient::disconnect().
 			</action>

Modified: commons/proper/net/branches/NET_2_0/src/test/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/test/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java?rev=756220&r1=756219&r2=756220&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/test/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/test/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParserTest.java
Thu Mar 19 21:36:02 2009
@@ -174,8 +174,17 @@
 	public void testNameWIthPunctuation() {
 		FTPFile f = getParser().parseFTPEntry("drwx------ 4 maxm Domain Users 512 Oct 2 10:59 abc(test)123.pdf");
 		assertNotNull(f);
-		assertEquals(f.getName(), "abc(test)123.pdf");
-		
+		assertEquals(f.getName(), "abc(test)123.pdf");	
+	}
+
+	public void testNoSpacesBeforeFileSize() {
+		FTPFile f = getParser().parseFTPEntry("drwxr-x---+1464 chrism   chrism     41472 Feb 25
13:17 20090225");
+		assertNotNull(f);
+		assertEquals(f.getSize(), 41472);
+		assertEquals(f.getType(), FTPFile.DIRECTORY_TYPE);
+		assertEquals(f.getUser(), "chrism");
+		assertEquals(f.getGroup(), "chrism");
+		assertEquals(f.getHardLinkCount(), 1464);
 	}
 
     /**



Mime
View raw message