com.sun.xml.ws.transport.httpspi.servlet
Class ServletResourceLoader

java.lang.Object
  extended by com.sun.xml.ws.transport.httpspi.servlet.ServletResourceLoader
All Implemented Interfaces:
ResourceLoader

public final class ServletResourceLoader
extends java.lang.Object
implements ResourceLoader

ResourceLoader backed by ServletContext.


Constructor Summary
ServletResourceLoader(javax.servlet.ServletContext context)
           
 
Method Summary
 java.net.URL getCatalogFile()
          Gets the catalog XML file that should be consulted when loading resources from this ResourceLoader.
 java.net.URL getResource(java.lang.String path)
          Returns the actual location of the resource from the 'path' that represents a virtual locaion of a file inside a web application.
 java.util.Set<java.lang.String> getResourcePaths(java.lang.String path)
          Returns the list of files in the given directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletResourceLoader

public ServletResourceLoader(javax.servlet.ServletContext context)
Method Detail

getResource

public java.net.URL getResource(java.lang.String path)
                         throws java.net.MalformedURLException
Description copied from interface: ResourceLoader
Returns the actual location of the resource from the 'path' that represents a virtual locaion of a file inside a web application.

Specified by:
getResource in interface ResourceLoader
Parameters:
path - Desiganates an absolute path within an web application, such as: '/WEB-INF/web.xml' or some such.
Returns:
the actual location, if found, or null if not found.
Throws:
java.net.MalformedURLException

getCatalogFile

public java.net.URL getCatalogFile()
                            throws java.net.MalformedURLException
Description copied from interface: ResourceLoader
Gets the catalog XML file that should be consulted when loading resources from this ResourceLoader.

Specified by:
getCatalogFile in interface ResourceLoader
Throws:
java.net.MalformedURLException

getResourcePaths

public java.util.Set<java.lang.String> getResourcePaths(java.lang.String path)
Description copied from interface: ResourceLoader
Returns the list of files in the given directory.

Specified by:
getResourcePaths in interface ResourceLoader
Returns:
null if the path is invalid. empty if the path didn't contain any entry in it.
See Also:
ServletContext.getResourcePaths(String)


Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.