commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwins...@apache.org
Subject svn commit: r161502 - jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java
Date Fri, 15 Apr 2005 16:46:29 GMT
Author: rwinston
Date: Fri Apr 15 09:46:29 2005
New Revision: 161502

URL: http://svn.apache.org/viewcvs?view=rev&rev=161502
Log:
Changed REGEX variable to accomodate date dtrings with only two components. There may be a
better way to do this, however this seems to support both types. Existing unit tests pass.

Modified:
    jakarta/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.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?view=diff&r1=161501&r2=161502
==============================================================================
--- 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
Fri Apr 15 09:46:29 2005
@@ -70,7 +70,7 @@
         + "(\\S+)\\s+"
         + "(?:(\\S+)\\s+)?"
         + "(\\d+)\\s+"
-		+ "(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+" /*the three parts of the date in any order*/
+		+ "(\\S+)\\s+(\\S+)\\s+((\\S+)(?:\\s+))?" /*the three parts of the date in any order*/
         + "(\\S+)(\\s*.*)";
 
 
@@ -129,9 +129,10 @@
             String usr = group(16);
             String grp = group(17);
             String filesize = group(18);
-            String datestr = group(19) + " " + group(20) + " " + group(21);
-            String name = group(22);
-            String endtoken = group(23);
+            String datestr = group(19) + " " + group(20);
+            if(group(22) != null && group(22) != "") datestr += " " +  group(22);
+            String name = group(23);
+            String endtoken = group(24);
 
             try
             {



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