Package org.apache.tools.ant.taskdefs
Class WhichResource
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.WhichResource
- All Implemented Interfaces:
- Cloneable
Find a class or resource on the supplied classpath, or the
 system classpath if none is supplied. The named property is set if
 the item can be found. For example
 
<whichresource resource="/log4j.properties" property="log4j.url" >
- Since:
- Ant 1.6
- 
Field SummaryFields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionAdds a path to the classpath.voidexecute()execute itvoidname the class to look forvoidsetClasspath(Path cp) Set the classpath to be used for this compilation.voidSet the classpath to use by reference.voidsetProperty(String property) the property to fill with the URL of the resource or classvoidsetResource(String resource) name the resource to look forMethods 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- 
WhichResourcepublic WhichResource()
 
- 
- 
Method Details- 
setClasspathSet the classpath to be used for this compilation.- Parameters:
- cp- the classpath to be used.
 
- 
createClasspath
- 
setClasspathRefSet the classpath to use by reference.- Parameters:
- r- a reference to an existing classpath.
- Since:
- Ant 1.7.1
 
- 
executeexecute it- Overrides:
- executein class- Task
- Throws:
- BuildException- on error
 
- 
setResourcename the resource to look for- Parameters:
- resource- the name of the resource to look for.
 
- 
setClassname the class to look for- Parameters:
- classname- the name of the class to look for.
 
- 
setPropertythe property to fill with the URL of the resource or class- Parameters:
- property- the property to be set.
 
 
-