jvanzyl     02/02/12 13:30:05

  Modified:    src/tdk/task/org/apache/tdk CreatePatternSet.java Get.java
  Log:
  - making a tiny string lib for the simple things needed
  - added a feature to httpget to indicate to users when JARs are
    non-distributable, and tell them where they can get them.
  
  Revision  Changes    Path
  1.2       +3 -55     
jakarta-turbine-tdk/src/tdk/task/org/apache/tdk/CreatePatternSet.java
  
  Index: CreatePatternSet.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-tdk/src/tdk/task/org/apache/tdk/CreatePatternSet.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CreatePatternSet.java     12 Feb 2002 16:51:41 -0000      1.1
  +++ CreatePatternSet.java     12 Feb 2002 21:30:05 -0000      1.2
  @@ -59,8 +59,6 @@
   import java.io.FileReader;
   import java.io.IOException;
   
  -import java.util.StringTokenizer;
  -
   import org.apache.tools.ant.Task;
   import org.apache.tools.ant.Project;
   import org.apache.tools.ant.BuildException;
  @@ -73,7 +71,7 @@
    * construct:
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Jason van Zyl</a>
  - * @version $Id: CreatePatternSet.java,v 1.1 2002/02/12 16:51:41 jvanzyl Exp $
  + * @version $Id: CreatePatternSet.java,v 1.2 2002/02/12 21:30:05 jvanzyl Exp $
    *
    */
   public class CreatePatternSet
  @@ -129,7 +127,7 @@
                   {
                       // We have something like the following pattern:
                       // include = conf/foo.xml
  -                    includesSb.append(split(line,"=",-1)[1]).append(",");
  +                    includesSb.append(StringUtil.split(line,"=",-1)[1]).append(",");
                       
                   }
                   
  @@ -137,7 +135,7 @@
                   {
                       // We have something like the following pattern:
                       // exclude = conf/foo.xml
  -                    excludesSb.append(split(line,"=",-1)[1]).append(",");
  +                    excludesSb.append(StringUtil.split(line,"=",-1)[1]).append(",");
                   }
   
               }
  @@ -190,56 +188,6 @@
               {
               }
           } 
  -    }
  -
  -    /**
  -     * Splits the provided text into a list, based on a given
  -     * separator.
  -     *
  -     * @param text Textual list to parse.
  -     * @param separator The separator character.
  -     * @param max The maximum number of elements to include in the
  -     * list.  A value of <code>-1</code> implies no limit.
  -     * @return The list of values.
  -     */
  -    private static String[] split(String text, String separator, int max)
  -    {
  -        StringTokenizer tok = new StringTokenizer(text, separator);
  -        int listSize = tok.countTokens();
  -        if (max != -1 && listSize > max)
  -        {
  -            listSize = max;
  -        }
  -
  -        String[] list = new String[listSize];
  -        int i = 0;
  -        while (tok.hasMoreTokens())
  -        {
  -            if (max != -1 && i == listSize - 1)
  -            {
  -                // In the situation where we hit the max yet have
  -                // tokens left over in our input, the last list
  -                // element gets all remaining text.
  -                StringBuffer buf = new StringBuffer
  -                    ((int) 1.2 * text.length() * (listSize - i) / listSize);
  -                while (tok.hasMoreTokens())
  -                {
  -                    buf.append(tok.nextToken());
  -                    if (tok.hasMoreTokens())
  -                    {
  -                        buf.append(separator);
  -                    }
  -                }
  -                list[i] = buf.toString();
  -                break;
  -            }
  -            else
  -            {
  -                list[i] = tok.nextToken();
  -            }
  -            i++;
  -        }
  -        return list;
       }
   }
   
  
  
  
  1.5       +8 -1      jakarta-turbine-tdk/src/tdk/task/org/apache/tdk/Get.java
  
  Index: Get.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-tdk/src/tdk/task/org/apache/tdk/Get.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Get.java  9 Feb 2002 15:08:50 -0000       1.4
  +++ Get.java  12 Feb 2002 21:30:05 -0000      1.5
  @@ -110,7 +110,14 @@
                   if (line.startsWith("#") || line.startsWith("--") || line.length() 
< 1)
                   {
                       continue;
  -                }                    
  +                }
  +                
  +                if (line.startsWith("<non-distributable>"))
  +                {
  +                    String entry[] = StringUtil.split(line,":",-1);
  +                    String jar = entry[1];
  +                    String location = entry[2];
  +                }
                   
                   l.add(line);
               }
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to