|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jetspeed.cache.disk.JetspeedDiskCache
Sample Implementation of the Disk Cache interface.
Entries are updated when DiskCacheDaemon runs
DiskCache
,
DiskCacheDaemon
Field Summary | |
static java.lang.String |
DEFAULT_CACHE_DIRECTORY
The default cache folder |
Method Summary | |
void |
add(java.lang.String url)
Add this URL to the disk cache |
void |
add(java.lang.String url,
boolean force)
|
java.lang.String |
fetch(java.lang.String url,
java.lang.String cache)
Get the URL from the Internet and then place it in the File dest. |
java.lang.String |
fetch(java.lang.String url,
java.lang.String cache,
boolean force)
Pulls in the remote URL from the net and saves it to disk |
DiskCacheEntry[] |
getEntries()
Get a list of all the documents within the cache... |
DiskCacheEntry |
getEntry(java.lang.String url)
Take the given remove URL and place it in the disk cache. |
DiskCacheEntry |
getEntry(java.lang.String url,
boolean force)
Force this URL to update |
DiskCacheEntry |
getEntry(java.lang.String url,
java.io.Reader is)
Get an Entry given a Reader and the URL from which it has been fetched. |
static JetspeedDiskCache |
getInstance()
Return the default instance of the JetspeedDiskCache cache. |
static JetspeedDiskCache |
getInstance(java.lang.String directory)
Return the default instance of the JetspeedDiskCache cache. |
java.lang.String |
getRoot()
Return the root of this DiskCache |
boolean |
isCached(java.lang.String url)
Ask if a url is in the DiskCache |
void |
refresh(java.lang.String url)
Tell the DiskCache that this URL should be refreshed. |
void |
remove(java.lang.String url)
Remove this URL from the disk cache. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static java.lang.String DEFAULT_CACHE_DIRECTORY
Method Detail |
public DiskCacheEntry[] getEntries()
getEntries
in interface DiskCache
DiskCache.getEntries()
public java.lang.String getRoot()
getRoot
in interface DiskCache
DiskCache.getRoot()
public DiskCacheEntry getEntry(java.lang.String url) throws java.io.IOException
DiskCache
Take the given remove URL and place it in the disk cache. Additionaly operations include building a DiskCacheEntry and then returning it.
getEntry may attempt to pull down the URL if it is not in the disk cache. Most implementations may provide support for changing this behavior so that you have to explicitly call add. This is done for performance reasons so that HTTP clients don't end up triggering a URL connection to fetch the given URL.
getEntry
in interface DiskCache
java.io.IOException
DiskCache.getEntry( String url )
public DiskCacheEntry getEntry(java.lang.String url, boolean force) throws java.io.IOException
getEntry
in interface DiskCache
java.io.IOException
DiskCache.getEntry( String url )
public DiskCacheEntry getEntry(java.lang.String url, java.io.Reader is) throws java.io.IOException
getEntry
in interface DiskCache
java.io.IOException
DiskCache.getEntry( String url, Reader is )
public void remove(java.lang.String url) throws java.io.IOException
DiskCache
remove
in interface DiskCache
java.io.IOException
DiskCache.remove( String url )
public void add(java.lang.String url) throws java.io.IOException
DiskCache
add
in interface DiskCache
java.io.IOException
DiskCache.add( String url )
public void add(java.lang.String url, boolean force) throws java.io.IOException
java.io.IOException
DiskCache.add( String url )
public java.lang.String fetch(java.lang.String url, java.lang.String cache) throws java.io.IOException
DiskCache
fetch
in interface DiskCache
url
- the url to retrievecache
- what file to store it in.
java.io.IOException
DiskCache.fetch( String url, String cache )
public java.lang.String fetch(java.lang.String url, java.lang.String cache, boolean force) throws java.io.IOException
url
- the url to retrievecache
- what file to store it in.
java.io.IOException
DiskCache.fetch( String url, String cache )
public void refresh(java.lang.String url)
DiskCache
refresh
in interface DiskCache
DiskCache.refresh(java.lang.String)
public static JetspeedDiskCache getInstance()
public static JetspeedDiskCache getInstance(java.lang.String directory)
public boolean isCached(java.lang.String url)
DiskCache
isCached
in interface DiskCache
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |