org.apache.cayenne.util
Class WebApplicationResourceLocator
java.lang.Object
org.apache.cayenne.util.ResourceLocator
org.apache.cayenne.util.WebApplicationResourceLocator
public class WebApplicationResourceLocator
- extends ResourceLocator
A ResourceLocator that can find resources relative to web application context.
- Author:
- Andrei Adamchik
Method Summary |
void |
addFilesystemPath(java.lang.String path)
Override ResourceLocator.addFilesystemPath(String) to intercept context paths
starting with "/WEB-INF/" to place in additionalContextPaths. |
java.net.URL |
findResource(java.lang.String location)
Looks for resources relative to /WEB-INF/ directory or any extra context paths
configured. |
javax.servlet.ServletContext |
getServletContext()
Gets the ServletContext used to locate resources. |
void |
setServletContext(javax.servlet.ServletContext servletContext)
Sets the ServletContext used to locate resources. |
Methods inherited from class org.apache.cayenne.util.ResourceLocator |
addClassPath, addFilesystemPath, classBaseUrl, findDirectoryResource, findFileInCurrentDirectory, findFileInFileSystem, findFileInHomeDirectory, findResourceInClasspath, findResourceInFileSystem, findResourceStream, findURLInClassLoader, findURLInClasspath, getClassLoader, setClassLoader, setSkipAbsolutePath, setSkipClasspath, setSkipCurrentDirectory, setSkipHomeDirectory, willSkipAbsolutePath, willSkipClasspath, willSkipCurrentDirectory, willSkipHomeDirectory |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
context
protected javax.servlet.ServletContext context
additionalContextPaths
protected java.util.List additionalContextPaths
WebApplicationResourceLocator
public WebApplicationResourceLocator()
- Since:
- 1.2
WebApplicationResourceLocator
public WebApplicationResourceLocator(javax.servlet.ServletContext context)
- Creates new WebApplicationResourceLocator with default lookup policy including user
home directory, current directory and CLASSPATH.
setServletContext
public void setServletContext(javax.servlet.ServletContext servletContext)
- Sets the ServletContext used to locate resources.
getServletContext
public javax.servlet.ServletContext getServletContext()
- Gets the ServletContext used to locate resources.
findResource
public java.net.URL findResource(java.lang.String location)
- Looks for resources relative to /WEB-INF/ directory or any extra context paths
configured. Internal ServletContext is used to find resources.
- Overrides:
findResource
in class ResourceLocator
addFilesystemPath
public void addFilesystemPath(java.lang.String path)
- Override ResourceLocator.addFilesystemPath(String) to intercept context paths
starting with "/WEB-INF/" to place in additionalContextPaths.
- Overrides:
addFilesystemPath
in class ResourceLocator
Copyright © 2001-2006 Apache.org All Rights Reserved.