Name
available
Synopsis
Conditionally sets a property if a resource is
available at runtime. The resource can be a class, file, directory,
or Java system resource. If the resource is present, the property is
set to true, or whatever the optional
value attribute is set to. Otherwise, the property
is not set.
Attributes
-
classname(all, String, *) A Java class name to look for, such as
com.oreilly.book.Author.-
classpath(all, Path, N) The classpath to use when looking up a class name or resource.
-
classpathref(all, Reference, N) A reference to a classpath defined elsewhere in the buildfile.
-
file(all, File, *) The name of a file to look for.
-
filepath(1.4, Path, N) The path of the file.
-
property(all, String, Y) The name of the property this task sets if the resource is found.
-
resource(all, String, *) A Java resource to look for. For more information on what constitutes a resource, see the various
getResource( )methods injava.lang.ClassLoader.-
type(1.4, String, N) Specifies what the
fileattribute represents. In Ant 1.4, legal values are"file"or"dir". If not specified, thefileattribute represents either a file or directory.-
value(all, String, N) The value assigned to the property if the resource is found. Defaults to
"true".
One of classname, file, or
resource is required.
Content
- 0,1 nested
<classpath>elements (all) Pathelement used in place of theclasspathattribute.- 0,1 nested
<filepath>elements (1.4) Pathelement used in place of thefilepathattribute.
Example Usage
The following ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access