ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/framework/exec/launchers ExecUtil.java
Date Sun, 30 Dec 2001 06:45:25 GMT
donaldp     01/12/29 22:45:25

  Modified:    proposal/myrmidon/src/java/org/apache/myrmidon/framework/exec/launchers
                        ExecUtil.java
  Log:
  Move implementation of toNativeEnvironment into this class rather than delegating
  
  Revision  Changes    Path
  1.5       +16 -3     jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/framework/exec/launchers/ExecUtil.java
  
  Index: ExecUtil.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/framework/exec/launchers/ExecUtil.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ExecUtil.java	23 Dec 2001 06:28:04 -0000	1.4
  +++ ExecUtil.java	30 Dec 2001 06:45:25 -0000	1.5
  @@ -9,8 +9,9 @@
   
   import java.io.File;
   import java.io.IOException;
  +import java.util.ArrayList;
  +import java.util.Iterator;
   import java.util.Properties;
  -import org.apache.myrmidon.framework.exec.Environment;
   import org.apache.myrmidon.framework.exec.ExecException;
   import org.apache.myrmidon.framework.exec.ExecMetaData;
   
  @@ -18,7 +19,7 @@
    * A set of utility functions useful when writing CommandLaunchers.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.4 $ $Date: 2001/12/23 06:28:04 $
  + * @version $Revision: 1.5 $ $Date: 2001/12/30 06:45:25 $
    */
   class ExecUtil
   {
  @@ -81,10 +82,22 @@
           throws ExecException
       {
           if( null == environment )
  +        {
               return null;
  +        }
           else
           {
  -            return Environment.toNativeFormat( environment );
  +            final ArrayList newEnvironment = new ArrayList();
  +
  +            final Iterator keys = environment.keySet().iterator();
  +            while( keys.hasNext() )
  +            {
  +                final String key = (String)keys.next();
  +                final String value = environment.getProperty( key );
  +                newEnvironment.add( key + '=' + value );
  +            }
  +
  +            return (String[])newEnvironment.toArray( new String[ newEnvironment.size()
] );
           }
       }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message