maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject cvs commit: jakarta-turbine-maven/src/java/org/apache/maven/jelly MavenJellyContext.java
Date Mon, 02 Dec 2002 03:15:08 GMT
jvanzyl     2002/12/01 19:15:08

  Modified:    src/java/org/apache/maven/jelly MavenJellyContext.java
  Log:
  o adding util method for dealing with csv lists of values like the remote repos.
  
  Revision  Changes    Path
  1.13      +24 -3     jakarta-turbine-maven/src/java/org/apache/maven/jelly/MavenJellyContext.java
  
  Index: MavenJellyContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jelly/MavenJellyContext.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- MavenJellyContext.java	2 Dec 2002 02:02:36 -0000	1.12
  +++ MavenJellyContext.java	2 Dec 2002 03:15:08 -0000	1.13
  @@ -60,9 +60,9 @@
   import org.apache.commons.jelly.TagLibrary;
   import org.apache.commons.jelly.XMLOutput;
   import org.apache.commons.jelly.tags.jeez.JeezTagLibrary;
  -import org.apache.commons.jelly.tags.ant.AntTagLibrary;
   import org.apache.commons.jelly.expression.Expression;
   import org.apache.commons.grant.GrantProject;
  +import org.apache.commons.lang.StringUtils;
   import org.apache.maven.MavenConstants;
   import org.apache.maven.Maven;
   import org.apache.maven.jelly.tags.MavenJeezTagLibrary;
  @@ -76,6 +76,7 @@
   import java.util.HashSet;
   import java.util.List;
   import java.util.Set;
  +import java.util.ArrayList;
   
   /** Specialized version of a <code>JellyContext</code>.
    *
  @@ -328,7 +329,27 @@
        */
       public List getMavenRepoRemote()
       {
  -        return (List) getVariable( MavenConstants.REPO_REMOTE );
  +        // We might have CSV list of remote repositories.
  +        return convertCsvStringToList( (String) getVariable( MavenConstants.REPO_REMOTE
) );
  +    }
  +
  +    /**
  +     * Convert a CSV list of values into a List
  +     *
  +     * @param csvString CVS list of values.
  +     * @return The List of value.
  +     */
  +    private List convertCsvStringToList( String csvString )
  +    {
  +        ArrayList list = new ArrayList();
  +        String[] s = StringUtils.split( csvString, "," );
  +
  +        for ( int i = 0; i < s.length; i++ )
  +        {
  +            list.add( s[i] );
  +        }
  +
  +        return list;
       }
   
       /**
  
  
  

Mime
View raw message