org.apache.tools.ant.taskdefs
public class Available extends Task implements Condition
Since: Ant 1.1
UNKNOWN: category="control"
Nested Class Summary | |
---|---|
static class | Available.FileDir
EnumeratedAttribute covering the file types to be checked for, either
file or dir. |
Method Summary | |
---|---|
Path | createClasspath()
Classpath to be used when searching for classes and resources.
|
Path | createFilepath()
Path to search for file resources.
|
boolean | eval()
Evaluate the availability of a resource.
|
void | execute()
Entry point when operating as a task.
|
void | setClassname(String classname)
Set a classname of a class which must be available to set the given
property.
|
void | setClasspath(Path classpath)
Set the classpath to be used when searching for classes and resources.
|
void | setClasspathRef(Reference r)
Set the classpath by reference.
|
void | setFile(File file)
Set the file which must be present in the file system to set the given
property.
|
void | setFilepath(Path filepath)
Set the path to use when looking for a file.
|
void | setIgnoresystemclasses(boolean ignore)
Set whether the search for classes should ignore the runtime classes and
just use the given classpath.
|
void | setProperty(String property)
Set the name of the property which will be set if the particular resource
is available.
|
void | setResource(String resource)
Set the name of a Java resource which is required to set the property.
|
void | setType(String type) |
void | setType(Available.FileDir type)
Set what type of file is required - either directory or file.
|
void | setValue(String value)
Set the value to be given to the property if the desired resource is
available.
|
Returns: an empty Path instance to be configured by Ant.
Returns: a new Path instance which Ant will configure with a file search path.
Returns: boolean is the resource is available.
Throws: BuildException if the condition is not configured correctly
Throws: BuildException if the task is not configured correctly.
Parameters: classname the name of the class required.
Parameters: classpath an Ant Path object containing the search path.
Parameters: r a Reference to a Path instance to be used as the classpath value.
Parameters: file the name of the file which is required.
Parameters: filepath a Path instance containing the search path for files.
Parameters: ignore true if system classes are to be ignored.
Parameters: property the name of the property to set.
Parameters: resource the name of a resource which is required to be available.
Deprecated: setType(String) is deprecated and is replaced with setType(Available.FileDir) to make Ant's Introspection mechanism do the work and also to encapsulate operations on the type in its own class.
Parameters: type the type of resource
Parameters: type an instance of the FileDir enumeratedAttribute indicating whether the file required is to be a directory or a plain file.
Parameters: value the value to be given.