Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.3.0)

E17493-04


javax.ide.util
Class MetaResource

java.lang.Object
  extended by javax.ide.util.MetaResource


public final class MetaResource
extends java.lang.Object

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.

See Also:
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

MetaResource

public MetaResource(java.lang.ClassLoader classLoader,
                    java.lang.String path)
Creates an MetaResource instance. Does not try to access the resource.
Parameters:
classLoader - the classloader that should load the resource
path - the relative path to the resource e.g. "images/foo.png"
Throws:
java.lang.NullPointerException - when either the classloader or the path are null.

Method Detail

toURL

public java.net.URL toURL()
Looks up a resource, starting at the classloader passed in. This method does not initialize the extension.
Returns:
the url of the resource if it exists or null if it does not

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Looks up a resource, and opens a resource stream on it starting at the classloader passed in. This method does not initialize the extension.
Returns:
opens and returns an InputStream of the resource if it exists or null if it does not
Throws:
java.io.IOException - if the openStream failed for whatever reason

getResourcePath

public java.lang.String getResourcePath()
Gets the resource path.
Returns:
the resource path

getClassLoader

public java.lang.ClassLoader getClassLoader()
Gets the classloader.
Returns:
the classloader

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.3.0)

E17493-04


Copyright © 1997, 2012, Oracle. All rights reserved.