Class FileCachePersist
- java.lang.Object
-
- de.businesscode.bcdui.web.cacheControl.FileCachePersist
-
- All Implemented Interfaces:
IServerCachePersist
public class FileCachePersist extends java.lang.Object implements IServerCachePersist
This class implements the file system based caching store.
-
-
Constructor Summary
Constructors Constructor Description FileCachePersist()
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clean(java.lang.String prefix)
Method clean
remove all cache items from the store depends on prefixvoid
dropItem(java.lang.String prefix, java.lang.String key)
Method dropItem
drop a single item, this method is necessary for clean job in case of occurred exceptionjava.io.InputStream
getInputStream(java.lang.String prefix, java.lang.String key)
Method getInputStreamlong
getLastModified(java.lang.String prefix, java.lang.String key)
Method getLastModifiedjava.io.OutputStream
getOutputStream(java.lang.String prefix, java.lang.String key)
Method getOutputStreamboolean
isCached(java.lang.String prefix, java.lang.String key)
Method isCachedvoid
setAbsoluteFolderPath(java.lang.String absoluteFolderPath)
Method setAbsoluteFolderPath
-
-
-
Method Detail
-
setAbsoluteFolderPath
public void setAbsoluteFolderPath(java.lang.String absoluteFolderPath)
Method setAbsoluteFolderPath- Parameters:
absoluteFolderPath
-
-
clean
public void clean(java.lang.String prefix) throws java.lang.Exception
Description copied from interface:IServerCachePersist
Method clean
remove all cache items from the store depends on prefix- Specified by:
clean
in interfaceIServerCachePersist
- Throws:
java.lang.Exception
- See Also:
IServerCachePersist.clean(String)
-
getInputStream
public java.io.InputStream getInputStream(java.lang.String prefix, java.lang.String key) throws java.lang.Exception
Description copied from interface:IServerCachePersist
Method getInputStream- Specified by:
getInputStream
in interfaceIServerCachePersist
- Returns:
- input stream for reading item depends on prefix and key. The InputStream will be closed by caller
- Throws:
java.lang.Exception
- See Also:
IServerCachePersist.getInputStream(String, String)
-
getOutputStream
public java.io.OutputStream getOutputStream(java.lang.String prefix, java.lang.String key) throws java.lang.Exception
Description copied from interface:IServerCachePersist
Method getOutputStream- Specified by:
getOutputStream
in interfaceIServerCachePersist
- Returns:
- output stream for creating a new item depends on prefix and key. The OutputStream will be closed by caller
- Throws:
java.lang.Exception
- See Also:
IServerCachePersist.getOutputStream(String, String)
-
dropItem
public void dropItem(java.lang.String prefix, java.lang.String key) throws java.lang.Exception
Description copied from interface:IServerCachePersist
Method dropItem
drop a single item, this method is necessary for clean job in case of occurred exception- Specified by:
dropItem
in interfaceIServerCachePersist
- Throws:
java.lang.Exception
- See Also:
IServerCachePersist.dropItem(String, String)
-
isCached
public boolean isCached(java.lang.String prefix, java.lang.String key) throws java.lang.Exception
Description copied from interface:IServerCachePersist
Method isCached- Specified by:
isCached
in interfaceIServerCachePersist
- Returns:
- true if the item depends on prefix and key available in the store
- Throws:
java.lang.Exception
- See Also:
IServerCachePersist.isCached(String, String)
-
getLastModified
public long getLastModified(java.lang.String prefix, java.lang.String key) throws java.lang.Exception
Description copied from interface:IServerCachePersist
Method getLastModified- Specified by:
getLastModified
in interfaceIServerCachePersist
- Returns:
- the long value represents the last modified timestamp in milliseconds
- Throws:
java.lang.Exception
- See Also:
IServerCachePersist.getLastModified(String, String)
-
-