Package com.sun.xml.ws.api
Class ResourceLoader
java.lang.Object
com.sun.xml.ws.api.ResourceLoader
Used to locate resources for jax-ws extensions. Using this, extensions
do not to have to write container specific code to locate resources.
- Author:
- Jitendra Kotamraju
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract URLgetResource(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.
-
Constructor Details
-
ResourceLoader
protected ResourceLoader()Default constructor.
-
-
Method Details
-
getResource
Returns the actual location of the resource from the 'resource' arg that represents a virtual locaion of a file understood by a container. ResourceLoader impl for a Container knows how to map this virtual location to actual location.Extensions can get hold of this object using
Container.
for e.g.: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); }- Parameters:
resource- Designates a path that is understood by the container. The implementations must support "jax-ws-catalog.xml" resource.- Returns:
- the actual location, if found, or null if not found.
- Throws:
MalformedURLException- if there is an error in creating URL
-