org.apache.tools.ant.taskdefs

Class WhichResource


public class WhichResource
extends Task

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 Summary

Fields inherited from class org.apache.tools.ant.Task

description, location, target, taskName, taskType, wrapper

Fields inherited from class org.apache.tools.ant.ProjectComponent

project

Method Summary

Path
createClasspath()
Adds a path to the classpath.
void
execute()
execute it
void
setClass(String classname)
name the class to look for
void
setClasspath(Path cp)
Set the classpath to be used for this compilation.
void
setProperty(String property)
the property to fill with the URL of the resource or class
void
setResource(String resource)
name the resource to look for

Methods inherited from class org.apache.tools.ant.Task

execute, getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType

Methods inherited from class org.apache.tools.ant.ProjectComponent

getProject, log, log, setProject

Method Details

createClasspath

public Path createClasspath()
Adds a path to the classpath.
Returns:
a classpath to be configured.

execute

public void execute()
            throws BuildException
execute it
Overrides:
execute in interface Task
Throws:
BuildException - on error

setClass

public void setClass(String classname)
name the class to look for
Parameters:
classname - the name of the class to look for.

setClasspath

public void setClasspath(Path cp)
Set the classpath to be used for this compilation.
Parameters:
cp - the classpath to be used.

setProperty

public void setProperty(String property)
the property to fill with the URL of the resource or class
Parameters:
property - the property to be set.

setResource

public void setResource(String resource)
name the resource to look for
Parameters:
resource - the name of the resource to look for.

Copyright B) 2000-2007 Apache Software Foundation. All Rights Reserved.