|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.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 DiskCacheDiskCache.getEntries()public java.lang.String getRoot()
getRoot in interface DiskCacheDiskCache.getRoot()
public DiskCacheEntry getEntry(java.lang.String url)
throws java.io.IOException
DiskCacheTake 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 DiskCachejava.io.IOExceptionDiskCache.getEntry( String url )
public DiskCacheEntry getEntry(java.lang.String url,
boolean force)
throws java.io.IOException
getEntry in interface DiskCachejava.io.IOExceptionDiskCache.getEntry( String url )
public DiskCacheEntry getEntry(java.lang.String url,
java.io.Reader is)
throws java.io.IOException
getEntry in interface DiskCachejava.io.IOExceptionDiskCache.getEntry( String url, Reader is )
public void remove(java.lang.String url)
throws java.io.IOException
DiskCache
remove in interface DiskCachejava.io.IOExceptionDiskCache.remove( String url )
public void add(java.lang.String url)
throws java.io.IOException
DiskCache
add in interface DiskCachejava.io.IOExceptionDiskCache.add( String url )
public void add(java.lang.String url,
boolean force)
throws java.io.IOException
java.io.IOExceptionDiskCache.add( String url )
public java.lang.String fetch(java.lang.String url,
java.lang.String cache)
throws java.io.IOException
DiskCache
fetch in interface DiskCacheurl - the url to retrievecache - what file to store it in.
java.io.IOExceptionDiskCache.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.IOExceptionDiskCache.fetch( String url, String cache )public void refresh(java.lang.String url)
DiskCache
refresh in interface DiskCacheDiskCache.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 | ||||||||||