|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.util.ResourceLocator
public class ResourceLocator
A utility class for working with resources.
Note: This class is for internal usage only. Any dependency from the
end-user will not be supported. Changes to this class will happen without a
warning.
Constructor Summary | |
---|---|
ResourceLocator()
|
Method Summary | |
---|---|
static URL |
getResourceFromClassLoaderChain(String resource)
This method looks for a resource using the ClassLoaders chain. |
static URL |
getResourceURL(String resourceName)
Finds a resource URL by its name. |
static URL |
resolveLocalURL(URL resource)
If we are inside an OSGi context the URL will not be a file but a bundleresource. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResourceLocator()
Method Detail |
---|
public static URL getResourceURL(String resourceName)
getResourceFromClassLoaderChain(String)
method. If the name does
not start with a leading slash and the resource was not found the first
time another try will be made by prefixing the name with a forward slash.
If the resource exists and an URL is obtained it is then resolved using
the resolveLocalURL(URL)
method.
resourceName
- the name to look for.
public static URL getResourceFromClassLoaderChain(String resource)
ResourceLocator
class and finally the system loader.
resource
- the name of the resource to look for.
null
if not found. The
first classloader responding with non-null value is the winner
and its response is returned.public static URL resolveLocalURL(URL resource)
resource
- the URL to convert
IOException
- if there is a problem to connect to the jar file.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |