|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.util.ResourceManager
Wrapper for getResourceAsStream, so we can get file-based resources with paths relative to the webapp root without needing a ServletContext object.
Field Summary | |
static String |
versionId
|
Method Summary | |
static ResourceManager |
getInstance()
implements singleton pattern |
long |
getLastModified(String path)
Returns the last-modified time for the file on disk. |
File |
getResourceAsFile(String url)
Returns a new File object that refers to the URL argument. |
InputStream |
getResourceAsStream(String url)
Returns a new InputStream object reading the URL argument. |
String |
getResourcePath(String url)
Gets the full path to a resource. |
javax.servlet.ServletContext |
getServletContext()
returns the ServletContext that this ResourceManager uses |
File |
getWebappRoot()
|
void |
setServletContext(javax.servlet.ServletContext sctx)
Configures this ResourceManager to use the specified servlet context. |
void |
setWebappRoot(File f)
Configures this ResourceManager to use the specified webapp root. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String versionId
Method Detail |
public static ResourceManager getInstance()
public InputStream getResourceAsStream(String url)
url
- a URL interpreted as a pathname relative to the webapp root
IllegalStateException
- if class is
not configured prior to use.public String getResourcePath(String url)
url
-
public File getResourceAsFile(String url)
url
- a URL interpreted as a pathname relative to the webapp root
IllegalStateException
- if class is
not configured prior to use.public void setWebappRoot(File f)
f
- the webapp root directorypublic void setServletContext(javax.servlet.ServletContext sctx)
sctx
- the servlet context.public javax.servlet.ServletContext getServletContext()
public File getWebappRoot()
public long getLastModified(String path)
IllegalStateException
- if class is
not configured prior to use.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |