|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.actf.util.resources.DefaultResourceLocator
org.eclipse.actf.util.resources.EclipseResourceLocator
public class EclipseResourceLocator
an implementation for locating resources within the Eclipse framework.
Field Summary |
---|
Fields inherited from interface org.eclipse.actf.util.resources.IResourceLocator |
---|
ACTF_RESOURCES_PATHS_KEY, DEFAULT_ACTF_RESOURCES_DIR |
Constructor Summary | |
---|---|
EclipseResourceLocator()
|
Method Summary | |
---|---|
String |
getPath(String name)
find the Path with the given name. Note: You may also pass a bundle name to this method to obtain a bundle path |
String[] |
getPaths(String name)
find the paths with the given name. |
IPath |
getPathToFile(String bundleName,
String relativePath)
|
URL |
getResource(String name)
find the resource with the given name. Search Algorithm is: Search through the registered ClassLoaders for the resource Search through the registered Bundles for the resource Test if the name is actually a Bundle |
InputStream |
getResourceAsStream(String id,
ClassLoader loader)
get the resource corresponding to the given id as a stream using the specified class loader. Note that resources are located in the context of bundles in Eclipse. |
InputStream |
getResourceAsStream(String id,
String base,
String ext,
ClassLoader loader)
get the resource corresponding to the given id as a stream using the specified class loader. |
InputStream |
getResourceAsStream(String id,
String base,
String ext,
String bundleName)
|
void |
registerBundleName(String bundle)
used to identify the bundles in which resources are to be found. |
Methods inherited from class org.eclipse.actf.util.resources.DefaultResourceLocator |
---|
getResourceAsBufferedStream, getResourceAsBufferedStream, getResourceAsStream, getResources, makeBufferedStream |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EclipseResourceLocator()
Method Detail |
---|
public void registerBundleName(String bundle)
ClassLoader
should not be passed to getResourceAsStream
. Also, not all methods for finding resources in bundles
use ClassLoader
objects.
bundle
- - the name of the bundle (i.e. plug-in) that is to be searched for a resourcepublic InputStream getResourceAsStream(String id, ClassLoader loader)
getResourceAsStream
in interface IResourceLocator
getResourceAsStream
in class DefaultResourceLocator
id
- - id of resourceloader
- -- class loader to use
#setBundle(String)
public InputStream getResourceAsStream(String id, String base, String ext, ClassLoader loader)
DefaultResourceLocator
getResourceAsStream
in interface IResourceLocator
getResourceAsStream
in class DefaultResourceLocator
id
- - id of resourcebase
- - base pathext
- -extentioloader
- -- class loader to use
public InputStream getResourceAsStream(String id, String base, String ext, String bundleName)
public URL getResource(String name)
Search Algorithm is:
getResource
in interface IResourceLocator
getResource
in class DefaultResourceLocator
name
- - name of resource
null
if
no resources with the given name could be foundClassLoader.getResource(String)
public String getPath(String name)
getPath
in interface IResourceLocator
getPath
in class DefaultResourceLocator
name
- - name of resource
null
if
no resources with the given name could be foundClassLoader.getResource(String)
public String[] getPaths(String name)
getPaths
in interface IResourceLocator
getPaths
in class DefaultResourceLocator
name
- - name of resource
null
if
no resources with the given name could be foundClassLoader.getResources(String)
public IPath getPathToFile(String bundleName, String relativePath)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |