diff --git a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Available.java b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Available.java index c7844055e..0821f0ecd 100644 --- a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Available.java +++ b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Available.java @@ -15,6 +15,7 @@ import org.apache.tools.ant.Task; 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 @@ import org.apache.tools.ant.types.Path; * stefano@apache.org * @author Magesh Umasankar */ - public class Available extends Task implements Condition @@ -123,7 +123,7 @@ public class Available if( m_classpath != null ) { - final URL[] urls = m_classpath.toURLs(); + final URL[] urls = PathUtil.toURLs( m_classpath ); m_classLoader = new URLClassLoader( urls ); } @@ -342,30 +342,4 @@ public class Available 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(); - } - } } diff --git a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/FileDir.java b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/FileDir.java new file mode 100644 index 000000000..46885971d --- /dev/null +++ b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/FileDir.java @@ -0,0 +1,36 @@ +/* + * 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(); + } +} diff --git a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Available.java b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Available.java index c7844055e..0821f0ecd 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Available.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Available.java @@ -15,6 +15,7 @@ import org.apache.tools.ant.Task; 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 @@ import org.apache.tools.ant.types.Path; * stefano@apache.org * @author Magesh Umasankar */ - public class Available extends Task implements Condition @@ -123,7 +123,7 @@ public class Available if( m_classpath != null ) { - final URL[] urls = m_classpath.toURLs(); + final URL[] urls = PathUtil.toURLs( m_classpath ); m_classLoader = new URLClassLoader( urls ); } @@ -342,30 +342,4 @@ public class Available 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(); - } - } } diff --git a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/FileDir.java b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/FileDir.java new file mode 100644 index 000000000..46885971d --- /dev/null +++ b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/FileDir.java @@ -0,0 +1,36 @@ +/* + * 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(); + } +}