commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Barrett" <JBarr...@sawyermedia.com>
Subject RE: [net][patch] jdk 1.4 specific call in VMSFTPEntryParser.java
Date Tue, 05 Aug 2003 17:19:27 GMT
whoops... absolutely:

Index: src/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParser.java
===================================================================
RCS file: /home/cvspublic/jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParser.java,v
retrieving revision 1.6
diff -u -r1.6 VMSFTPEntryParser.java
--- src/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParser.java   29 Jul 2003 02:35:34
-0000   1.6
+++ src/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParser.java   5 Aug 2003 17:18:52
-0000
@@ -54,8 +54,11 @@
  * <http://www.apache.org/>.
  */

+import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.HashMap;
+import java.util.List;
+import java.util.StringTokenizer;
 import java.io.BufferedReader;
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
@@ -271,18 +274,24 @@
             String min = group(7);
             String sec = group(8);
             String owner = group(9);
-            String[] array = owner.split(",");
+
+            List list = new ArrayList();
+            StringTokenizer st = new StringTokenizer(owner,",");
+            while (st.hasMoreTokens()) {
+                list.add( st.nextToken() );
+            }
+
             String grp;
             String user;

-            switch (array.length) {
+            switch (list.size()) {
                 case 1:
                     grp = null;
-                    user = array[0];
+                    user = list.get(0).toString();
                     break;
                 case 2:
-                    grp = array[0];
-                    user = array[1];
+                    grp = list.get(0).toString();
+                    user = list.get(1).toString();
                     break;
                 default:
                     grp = null;

> -----Original Message-----
> From: Daniel F. Savarese [mailto:dfs@savarese.org]
> Sent: Tuesday, August 05, 2003 10:11 AM
> To: Jakarta Commons Developers List
> Subject: Re: [net][patch] jdk 1.4 specific call in
> VMSFTPEntryParser.java 
> 
> 
> 
> In message 
> <378277A8F8AD4049AD8BC80D1F2B95396B6BFA@sawmailsf1.sawyermedia.local
> >, "Jeff Barrett" writes:
> >sorry.  this patch passes the unit test:
> 
> I'm having a heck of a time applying the patch (patch keeps 
> on spouting
> "patch: **** `>' expected at line 10 of patch" for some 
> reason) and don't
> want to run the risk of error by inserting the lines 
> manually.  Can you
> post the patch in unified diff format (diff -u)?
> 
> thanks,
> daniel
> 
> 
> 
> ---------------------------------------------------------------------
> 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