|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.deltava.util.cache.Cache<CacheableFile>
org.deltava.util.cache.FileCache
public class FileCache
A cache for File handles.
| Nested Class Summary | |
|---|---|
protected static class |
FileCache.FileCacheEntry
|
| Field Summary |
|---|
| Fields inherited from class org.deltava.util.cache.Cache |
|---|
_cache |
| Constructor Summary | |
|---|---|
FileCache(int maxSize)
Initializes the cache. |
|
| Method Summary | |
|---|---|
protected void |
addEntry(CacheableFile obj)
Adds an entry to the cache. |
protected void |
addNullEntry(Object key)
Not implemented. |
void |
clear()
Clears the cache and deletes any cached files. |
CacheableFile |
get(Object key)
Returns an entry from the cache. |
void |
remove(Object key)
Invalidates a cache entry and deletes the file from the filesystem. |
void |
setMaxAge(int age)
Sets the maximum age of a file before it should be expired (and deleted) when queried. |
| Methods inherited from class org.deltava.util.cache.Cache |
|---|
add, addAll, addNull, checkOverflow, contains, getHits, getMaxSize, getRequests, hit, request, setMaxSize, size |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileCache(int maxSize)
maxSize - the maximum number of entries in the cache| Method Detail |
|---|
protected void addEntry(CacheableFile obj)
addEntry in class Cache<CacheableFile>obj - the file to add to the cacheprotected void addNullEntry(Object key)
addNullEntry in class Cache<CacheableFile>key - the entry keypublic final void remove(Object key)
remove in class Cache<CacheableFile>key - the entry keypublic final void clear()
clear in class Cache<CacheableFile>public void setMaxAge(int age)
age - the age in minutes or 0 for no expirationpublic CacheableFile get(Object key)
get in class Cache<CacheableFile>key - the cache key
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||