commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Barrett" <JBarr...@sawyermedia.com>
Subject [net][patch] jdk 1.4 specific call in VMSFTPEntryParser.java
Date Tue, 05 Aug 2003 02:23:27 GMT
There's a call in the most current version of VMSFTPEntryParser that calls jdk 1.4's String.split()
method.  The below code replaces the split call with backwards-compatible use of StringTokenizer.
 It's not pretty, but it doesn't require inclusion of commons-lang, oro, or regexp.

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 -r1.6 VMSFTPEntryParser.java
56a57
> import java.util.ArrayList;
58a60,61
> import java.util.List;
> import java.util.StringTokenizer;
274c277,284
<             String[] array = owner.split(",");
---
>
>             List tokens = new ArrayList();
>             StringTokenizer st = new StringTokenizer(owner,",");
>             while (st.hasMoreTokens()) {
>                 tokens.add( st.nextToken() );
>             }
>             String[] array = (String[])tokens.toArray();
>


The information in this email and subsequent attachments may contain confidential information
that is intended solely for the attention and use of the named addressee(s). This message
or any part thereof must not be disclosed, copied, distributed, or retained by any person
without the authorization from the addressee.

 

Mime
View raw message