|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mortbay.http.ResourceCache
Nested Class Summary | |
class |
ResourceCache.ResourceMetaData
MetaData associated with a context Resource. |
Constructor Summary | |
ResourceCache()
Constructor. |
Method Summary | |
void |
destroy()
Destroy a context. |
void |
flushCache()
|
Resource |
getBaseResource()
Get the base resource. |
java.lang.String |
getEncodingByMimeType(java.lang.String type)
Get char encoding by mime type. |
java.util.Map |
getEncodingMap()
Get the map of mime type to char encoding. |
int |
getMaxCachedFileSize()
|
int |
getMaxCacheSize()
|
java.lang.String |
getMimeByExtension(java.lang.String filename)
Get the MIME type by filename extension. |
java.util.Map |
getMimeMap()
|
Resource |
getResource(java.lang.String pathInContext)
Get a resource from the context. |
java.lang.String |
getResourceBase()
Set the Resource Base. |
ResourceCache.ResourceMetaData |
getResourceMetaData(Resource resource)
Get Resource MetaData. |
boolean |
isStarted()
|
void |
setBaseResource(Resource base)
Set the base resource. |
void |
setEncodingMap(java.util.Map encodingMap)
Set the map of mime type to char encoding. |
void |
setMaxCachedFileSize(int maxCachedFileSize)
|
void |
setMaxCacheSize(int maxCacheSize)
|
void |
setMimeMap(java.util.Map mimeMap)
Also sets the org.mortbay.http.mimeMap context attribute |
void |
setMimeMapping(java.lang.String extension,
java.lang.String type)
Set a mime mapping |
void |
setResourceBase(java.lang.String resourceBase)
Set the Resource Base. |
void |
setTypeEncoding(java.lang.String mimeType,
java.lang.String encoding)
Set the encoding that should be used for a mimeType. |
void |
start()
Start the LifeCycle. |
void |
stop()
Stop the context. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ResourceCache()
Method Detail |
public java.lang.String getResourceBase()
public void setResourceBase(java.lang.String resourceBase)
resourceBase
- A URL prefix or directory name.public Resource getBaseResource()
public void setBaseResource(Resource base)
base
- The resourceBase as a Resource instancepublic int getMaxCachedFileSize()
public void setMaxCachedFileSize(int maxCachedFileSize)
public int getMaxCacheSize()
public void setMaxCacheSize(int maxCacheSize)
public void flushCache()
public Resource getResource(java.lang.String pathInContext) throws java.io.IOException
pathInContext
-
java.io.IOException
public java.util.Map getMimeMap()
public void setMimeMap(java.util.Map mimeMap)
mimeMap
- public java.lang.String getMimeByExtension(java.lang.String filename)
filename
- A file name
public void setMimeMapping(java.lang.String extension, java.lang.String type)
extension
- type
- public java.util.Map getEncodingMap()
public void setEncodingMap(java.util.Map encodingMap)
encodingMap
- Map of mime type to character encodings.public java.lang.String getEncodingByMimeType(java.lang.String type)
type
- A mime type.
public void setTypeEncoding(java.lang.String mimeType, java.lang.String encoding)
mimeType
- encoding
- public void start() throws java.lang.Exception
LifeCycle
start
in interface LifeCycle
java.lang.Exception
- An arbitrary exception may be thrown.public boolean isStarted()
isStarted
in interface LifeCycle
public void stop() throws java.lang.InterruptedException
stop
in interface LifeCycle
java.lang.InterruptedException
- Stopping a lifecycle is rarely atomic
and may be interrupted by another thread. If this happens
InterruptedException is throw and the component will be in an
indeterminant state and should probably be discarded.public void destroy()
public ResourceCache.ResourceMetaData getResourceMetaData(Resource resource)
resource
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |