Top Description Constructors Methods
org.apache.tools.ant.types.resources

public Class JavaResource

extends AbstractClasspathResource
implements URLProvider
Class Inheritance
All Implemented Interfaces
org.apache.tools.ant.types.resources.URLProvider
Imports
java.io.FileNotFoundException, .IOException, .InputStream, java.net.URL, org.apache.tools.ant.types.Path, .Resource

A Resource representation of something loadable via a Java classloader.
Since
Ant 1.7

Constructor Summary

AccessConstructor and Description
public
JavaResource()

Default constructor.

public
JavaResource(String
the resource name.
name
,
Path
the classpath.
path
)

Construct a new JavaResource using the specified name and classpath.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

a negative integer, zero, or a positive integer as this JavaResource is less than, equal to, or greater than the specified Resource.
compareTo
(Resource
the other Resource against which to compare.
another
)

Overrides org.apache.tools.ant.types.Resource.compareTo.

Implements java.lang.Comparable.compareTo.

Compare this JavaResource to another Resource.
protected JavaResource
getRef()

Overrides org.apache.tools.ant.types.resources.AbstractClasspathResource.getRef.

Perform the check for circular references and return the referenced Resource.
public URL
getURL()

Implements org.apache.tools.ant.types.resources.URLProvider.getURL.

Get the URL represented by this Resource.
protected InputStream

Returns:

an open input stream for the resource
openInputStream
(ClassLoader
the classloader to use. Will be null if the system classloader is used
cl
)

Implements abstract org.apache.tools.ant.types.resources.AbstractClasspathResource.openInputStream.

open the input stream from a specific classloader
Inherited from org.apache.tools.ant.types.resources.AbstractClasspathResource:
createClasspathdieOnCircularReferencegetClassLoadergetClasspathgetInputStreamgetLoaderisExistssetClasspathsetClasspathRefsetLoaderRefsetParentFirstsetRefid

Constructor Detail

JavaResourceback to summary
public JavaResource()

Default constructor.

JavaResourceback to summary
public JavaResource(String name, Path path)

Construct a new JavaResource using the specified name and classpath.

Parameters
name:String

the resource name.

path:Path

the classpath.

Method Detail

compareToback to summary
public int compareTo(Resource another)

Overrides org.apache.tools.ant.types.Resource.compareTo.

Implements java.lang.Comparable.compareTo.

Compare this JavaResource to another Resource.

Parameters
another:Resource

the other Resource against which to compare.

Returns:int

a negative integer, zero, or a positive integer as this JavaResource is less than, equal to, or greater than the specified Resource.

Annotations
@Override
getRefback to summary
protected JavaResource getRef()

Overrides org.apache.tools.ant.types.resources.AbstractClasspathResource.getRef.

Doc from org.apache.tools.ant.types.Resource.getRef.

Perform the check for circular references and return the referenced Resource.

Returns:JavaResource

Resource.

Annotations
@Override
getURLback to summary
public URL getURL()

Implements org.apache.tools.ant.types.resources.URLProvider.getURL.

Get the URL represented by this Resource.

Returns:URL

Doc from org.apache.tools.ant.types.resources.URLProvider.getURL.

the file.

Annotations
@Override
Since
Ant 1.8.0
openInputStreamback to summary
protected InputStream openInputStream(ClassLoader cl) throws IOException

Implements abstract org.apache.tools.ant.types.resources.AbstractClasspathResource.openInputStream.

open the input stream from a specific classloader

Parameters
cl:ClassLoader

the classloader to use. Will be null if the system classloader is used

Returns:InputStream

an open input stream for the resource

Exceptions
IOException:
if an error occurs.