You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Jeff Barrett <JB...@sawyermedia.com> on 2003/08/05 04:23:27 UTC

[net][patch] jdk 1.4 specific call in VMSFTPEntryParser.java

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.

 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org