public abstract class ResourceLoader extends Object
| Constructor and Description |
|---|
ResourceLoader() |
| Modifier and Type | Method and Description |
|---|---|
abstract URL |
getResource(String resource)
Returns the actual location of the resource from the 'resource' arg
that represents a virtual locaion of a file understood by a container.
|
public abstract URL getResource(String resource) throws MalformedURLException
Extensions can get hold of this object using Container.
ResourceLoader loader = container.getSPI(ResourceLoader.class);
URL catalog = loader.get("jax-ws-catalog.xml");
A ResourceLoader for servlet environment, may do the following.
URL getResource(String resource) {
return servletContext.getResource("/WEB-INF/"+resource);
}
resource - Designates a path that is understood by the container. The
implementations must support "jax-ws-catalog.xml" resource.MalformedURLException - if there is an error in creating URLCopyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.