|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.2.0) E17493-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
javax.ide.util.MetaResource
public final class MetaResource
Provides delayed loading for resources. This is a utility class for storing resource and classloader pairs. It can be used to store paths to resources without looking them up as in the case of images and properties file. It can also be used in cases where a given resource, e.g. an xml file, contains class references that should all resolve with the given classloader.
MetaClass
Constructor Summary | |
---|---|
MetaResource(java.lang.ClassLoader classLoader, java.lang.String path) Creates an MetaResource instance. |
Method Summary | |
---|---|
java.lang.ClassLoader |
getClassLoader() Gets the classloader. |
java.io.InputStream |
getInputStream() Looks up a resource, and opens a resource stream on it starting at the classloader passed in. |
java.lang.String |
getResourcePath() Gets the resource path. |
java.net.URL |
toURL() Looks up a resource, starting at the classloader passed in. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MetaResource(java.lang.ClassLoader classLoader, java.lang.String path)
classLoader
- the classloader that should load the resourcepath
- the relative path to the resource e.g. "images/foo.png"java.lang.NullPointerException
- when either the classloader or the path are null
.Method Detail |
---|
public java.net.URL toURL()
null
if it does notpublic java.io.InputStream getInputStream() throws java.io.IOException
InputStream
of the resource if it exists or null
if it does notjava.io.IOException
- if the openStream failed for whatever reasonpublic java.lang.String getResourcePath()
public java.lang.ClassLoader getClassLoader()
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.2.0) E17493-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |