Class JavaResource
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.types.DataType
org.apache.tools.ant.types.Resource
org.apache.tools.ant.types.resources.AbstractClasspathResource
org.apache.tools.ant.types.resources.JavaResource
- All Implemented Interfaces:
- Cloneable,- Comparable<Resource>,- Iterable<Resource>,- ResourceCollection,- URLProvider
A Resource representation of something loadable via a Java classloader.
- Since:
- Ant 1.7
- 
Nested Class SummaryNested classes/interfaces inherited from class org.apache.tools.ant.types.resources.AbstractClasspathResourceAbstractClasspathResource.ClassLoaderWithFlag
- 
Field SummaryFields inherited from class org.apache.tools.ant.types.ResourceMAGIC, UNKNOWN_DATETIME, UNKNOWN_SIZEFields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
- 
Constructor SummaryConstructorsConstructorDescriptionDefault constructor.JavaResource(String name, Path path) Construct a new JavaResource using the specified name and classpath.
- 
Method SummaryModifier and TypeMethodDescriptionintCompare this JavaResource to another Resource.protected JavaResourcegetRef()Perform the check for circular references and return the referenced Resource.getURL()Get the URL represented by this Resource.protected InputStreamopen the input stream from a specific classloaderMethods inherited from class org.apache.tools.ant.types.resources.AbstractClasspathResourcecreateClasspath, dieOnCircularReference, getClassLoader, getClasspath, getInputStream, getLoader, isExists, setClasspath, setClasspathRef, setLoaderRef, setParentFirst, setRefidMethods inherited from class org.apache.tools.ant.types.Resourceas, asOptional, clone, equals, getLastModified, getMagicNumber, getName, getOutputStream, getSize, hashCode, isDirectory, isFilesystemOnly, iterator, setDirectory, setExists, setLastModified, setName, setSize, size, toLongString, toStringMethods inherited from class org.apache.tools.ant.types.DataTypecheckAttributesAllowed, checkChildrenAllowed, circularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, tooManyAttributesMethods inherited from class org.apache.tools.ant.ProjectComponentgetDescription, getLocation, getProject, log, log, setDescription, setLocation, setProjectMethods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.IterableforEach, spliteratorMethods inherited from interface org.apache.tools.ant.types.ResourceCollectionisEmpty, stream
- 
Constructor Details- 
JavaResourcepublic JavaResource()Default constructor.
- 
JavaResource
 
- 
- 
Method Details- 
openInputStreamopen the input stream from a specific classloader- Specified by:
- openInputStreamin class- AbstractClasspathResource
- Parameters:
- cl- the classloader to use. Will be null if the system classloader is used
- Returns:
- an open input stream for the resource
- Throws:
- IOException- if an error occurs.
 
- 
getURLGet the URL represented by this Resource.- Specified by:
- getURLin interface- URLProvider
- Returns:
- the file.
- Since:
- Ant 1.8.0
 
- 
compareToCompare this JavaResource to another Resource.- Specified by:
- compareToin interface- Comparable<Resource>
- Overrides:
- compareToin class- Resource
- Parameters:
- another- the other Resource against which to compare.
- Returns:
- a negative integer, zero, or a positive integer as this JavaResource is less than, equal to, or greater than the specified Resource.
 
- 
getRefDescription copied from class:ResourcePerform the check for circular references and return the referenced Resource.- Overrides:
- getRefin class- AbstractClasspathResource
- Returns:
- Resource.
 
 
-