Moved toURL from Path to PathUtils git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270806 13f79535-47bb-0310-9956-ffa450edef68master
@@ -15,6 +15,7 @@ import org.apache.tools.ant.Task; | |||||
import org.apache.tools.ant.taskdefs.condition.Condition; | import org.apache.tools.ant.taskdefs.condition.Condition; | ||||
import org.apache.tools.ant.types.EnumeratedAttribute; | import org.apache.tools.ant.types.EnumeratedAttribute; | ||||
import org.apache.tools.ant.types.Path; | 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 | * 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</a> | * stefano@apache.org</a> | ||||
* @author <a href="mailto:umagesh@apache.org">Magesh Umasankar</a> | * @author <a href="mailto:umagesh@apache.org">Magesh Umasankar</a> | ||||
*/ | */ | ||||
public class Available | public class Available | ||||
extends Task | extends Task | ||||
implements Condition | implements Condition | ||||
@@ -123,7 +123,7 @@ public class Available | |||||
if( m_classpath != null ) | if( m_classpath != null ) | ||||
{ | { | ||||
final URL[] urls = m_classpath.toURLs(); | |||||
final URL[] urls = PathUtil.toURLs( m_classpath ); | |||||
m_classLoader = new URLClassLoader( urls ); | m_classLoader = new URLClassLoader( urls ); | ||||
} | } | ||||
@@ -342,30 +342,4 @@ public class Available | |||||
return m_classLoader; | 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(); | |||||
} | |||||
} | |||||
} | } |
@@ -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(); | |||||
} | |||||
} |
@@ -15,6 +15,7 @@ import org.apache.tools.ant.Task; | |||||
import org.apache.tools.ant.taskdefs.condition.Condition; | import org.apache.tools.ant.taskdefs.condition.Condition; | ||||
import org.apache.tools.ant.types.EnumeratedAttribute; | import org.apache.tools.ant.types.EnumeratedAttribute; | ||||
import org.apache.tools.ant.types.Path; | 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 | * 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</a> | * stefano@apache.org</a> | ||||
* @author <a href="mailto:umagesh@apache.org">Magesh Umasankar</a> | * @author <a href="mailto:umagesh@apache.org">Magesh Umasankar</a> | ||||
*/ | */ | ||||
public class Available | public class Available | ||||
extends Task | extends Task | ||||
implements Condition | implements Condition | ||||
@@ -123,7 +123,7 @@ public class Available | |||||
if( m_classpath != null ) | if( m_classpath != null ) | ||||
{ | { | ||||
final URL[] urls = m_classpath.toURLs(); | |||||
final URL[] urls = PathUtil.toURLs( m_classpath ); | |||||
m_classLoader = new URLClassLoader( urls ); | m_classLoader = new URLClassLoader( urls ); | ||||
} | } | ||||
@@ -342,30 +342,4 @@ public class Available | |||||
return m_classLoader; | 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(); | |||||
} | |||||
} | |||||
} | } |
@@ -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(); | |||||
} | |||||
} |