commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Barrett" <>
Subject [net][patch] jdk 1.4 specific call in
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/
RCS file: /home/cvspublic/jakarta-commons/net/src/java/org/apache/commons/net/ftp/parser/,v
retrieving revision 1.6
diff -r1.6
> import java.util.ArrayList;
> import java.util.List;
> import java.util.StringTokenizer;
<             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.


View raw message