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/main/org/apache/tools/ant/taskdefs FileDir.java Available.java
Date Sun, 20 Jan 2002 09:53:53 GMT
donaldp     02/01/20 01:53:53

  Modified:    proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs
                        Available.java
  Added:       proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs
                        FileDir.java
  Log:
  Moved inner class to be a top level class
  
  Moved toURL from Path to PathUtils
  
  Revision  Changes    Path
  1.18      +2 -28     jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Available.java
  
  Index: Available.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Available.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- Available.java	17 Jan 2002 08:04:54 -0000	1.17
  +++ Available.java	20 Jan 2002 09:53:53 -0000	1.18
  @@ -15,6 +15,7 @@
   import org.apache.tools.ant.taskdefs.condition.Condition;
   import org.apache.tools.ant.types.EnumeratedAttribute;
   import org.apache.tools.ant.types.Path;
  +import org.apache.tools.ant.types.PathUtil;
   
   /**
    * Will set the given property if the requested resource is available at
  @@ -24,7 +25,6 @@
    *      stefano@apache.org</a>
    * @author <a href="mailto:umagesh@apache.org">Magesh Umasankar</a>
    */
  -
   public class Available
       extends Task
       implements Condition
  @@ -123,7 +123,7 @@
   
           if( m_classpath != null )
           {
  -            final URL[] urls = m_classpath.toURLs();
  +            final URL[] urls = PathUtil.toURLs( m_classpath );
               m_classLoader = new URLClassLoader( urls );
           }
   
  @@ -340,32 +340,6 @@
           else
           {
               return m_classLoader;
  -        }
  -    }
  -
  -    public static class FileDir extends EnumeratedAttribute
  -    {
  -
  -        private final static String[] values = {"file", "dir"};
  -
  -        public String[] getValues()
  -        {
  -            return values;
  -        }
  -
  -        public boolean isDir()
  -        {
  -            return "dir".equalsIgnoreCase( getValue() );
  -        }
  -
  -        public boolean isFile()
  -        {
  -            return "file".equalsIgnoreCase( getValue() );
  -        }
  -
  -        public String toString()
  -        {
  -            return getValue();
           }
       }
   }
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/FileDir.java
  
  Index: FileDir.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.tools.ant.taskdefs;
  
  import org.apache.tools.ant.types.EnumeratedAttribute;
  
  public class FileDir
      extends EnumeratedAttribute
  {
      private final static String[] values = {"file", "dir"};
  
      public String[] getValues()
      {
          return values;
      }
  
      public boolean isDir()
      {
          return "dir".equalsIgnoreCase( getValue() );
      }
  
      public boolean isFile()
      {
          return "file".equalsIgnoreCase( getValue() );
      }
  
      public String toString()
      {
          return getValue();
      }
  }
  
  
  

--
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