Package org.apache.tools.ant.taskdefs
Class Available
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.Available
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classEnumeratedAttribute covering the file types to be checked for, either file or dir.
- 
Field SummaryFields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionClasspath to be used when searching for classes and resources.Path to search for file resources.booleaneval()Evaluate the availability of a resource.voidexecute()Entry point when operating as a task.voidsetClassname(String classname) Set a classname of a class which must be available to set the given property.voidsetClasspath(Path classpath) Set the classpath to be used when searching for classes and resources.voidSet the classpath by reference.voidSet the file which must be present in the file system to set the given property.voidsetFilepath(Path filepath) Set the path to use when looking for a file.voidsetIgnoresystemclasses(boolean ignore) Set whether the search for classes should ignore the runtime classes and just use the given classpath.voidsetProperty(String property) Set the name of the property which will be set if the particular resource is available.voidsetResource(String resource) Set the name of a Java resource which is required to set the property.voidsetSearchParents(boolean searchParents) Set the searchParents attribute.voidDeprecated.since 1.5.x.voidsetType(Available.FileDir type) Set what type of file is required - either directory or file.voidSet the value to be given to the property if the desired resource is available.voidSet the value to be given to the property if the desired resource is available.Methods inherited from class org.apache.tools.ant.TaskbindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponentclone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
- 
Constructor Details- 
Availablepublic Available()
 
- 
- 
Method Details- 
setSearchParentspublic void setSearchParents(boolean searchParents) Set the searchParents attribute. This controls the behaviour of the the "file" type. If true, the path, parent path and grandparent path are searched for the file. If false, only the path is searched. The default value is false.- Parameters:
- searchParents- the value to set.
 
- 
setClasspathSet the classpath to be used when searching for classes and resources.- Parameters:
- classpath- an Ant Path object containing the search path.
 
- 
createClasspathClasspath to be used when searching for classes and resources.- Returns:
- an empty Path instance to be configured by Ant.
 
- 
setClasspathRefSet the classpath by reference.- Parameters:
- r- a Reference to a Path instance to be used as the classpath value.
 
- 
setFilepathSet the path to use when looking for a file.- Parameters:
- filepath- a Path instance containing the search path for files.
 
- 
createFilepathPath to search for file resources.- Returns:
- a new Path instance which Ant will configure with a file search path.
 
- 
setPropertySet the name of the property which will be set if the particular resource is available.- Parameters:
- property- the name of the property to set.
 
- 
setValueSet the value to be given to the property if the desired resource is available.- Parameters:
- value- the value to be given.
 
- 
setValueSet the value to be given to the property if the desired resource is available.- Parameters:
- value- the value to be given.
 
- 
setClassnameSet a classname of a class which must be available to set the given property.- Parameters:
- classname- the name of the class required.
 
- 
setFileSet the file which must be present in the file system to set the given property.- Parameters:
- file- the name of the file which is required.
 
- 
setResourceSet the name of a Java resource which is required to set the property.- Parameters:
- resource- the name of a resource which is required to be available.
 
- 
setTypeDeprecated.since 1.5.x. 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
 
- 
setTypeSet what type of file is required - either directory or file.- Parameters:
- type- an instance of the FileDir enumeratedAttribute indicating whether the file required is to be a directory or a plain file.
 
- 
setIgnoresystemclassespublic void setIgnoresystemclasses(boolean ignore) Set whether the search for classes should ignore the runtime classes and just use the given classpath.- Parameters:
- ignore- true if system classes are to be ignored.
 
- 
executeEntry point when operating as a task.- Overrides:
- executein class- Task
- Throws:
- BuildException- if the task is not configured correctly.
 
- 
evalEvaluate the availability of a resource.- Specified by:
- evalin interface- Condition
- Returns:
- boolean is the resource is available.
- Throws:
- BuildException- if the condition is not configured correctly
 
 
-