public class CacheEntry
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
KEY_JNLP_PATH |
Constructor and Description |
---|
CacheEntry(java.net.URL location,
Version version)
Create a CacheEntry for the resources specified as a remote
URL.
|
Modifier and Type | Method and Description |
---|---|
long |
getLastModified() |
long |
getLastUpdated()
Returns the time in the local system clock that the file was
most recently checked for an update.
|
java.io.File |
getLocalFile() |
java.net.URL |
getLocation()
Returns the remote location this entry caches.
|
long |
getRemoteContentLength() |
boolean |
isCached()
Returns true if the cache has a local copy of the contents
of the URL matching the specified version string.
|
boolean |
isCached(java.io.File cachedFile) |
boolean |
isCurrent(long lastModified)
Returns whether there is a version of the URL contents in
the cache and it is up to date.
|
boolean |
isCurrent(long lastModified,
java.io.File cachedFile) |
protected boolean |
isHeldByCurrentThread() |
protected void |
lock()
Lock cache item.
|
void |
markForDelete()
Mark this entry for deletion at shutdown.
|
void |
setJnlpPath(java.lang.String jnlpPath) |
void |
setLastModified(long modifyTime) |
void |
setLastUpdated(long updatedTime)
Sets the time in the local system clock that the file was
most recently checked for an update.
|
void |
setRemoteContentLength(long length) |
protected boolean |
store()
Save the current information for the cache entry.
|
protected boolean |
tryLock() |
protected void |
unlock()
Unlock cache item.
|
public static final java.lang.String KEY_JNLP_PATH
public CacheEntry(java.net.URL location, Version version)
location
- the remote resource locationversion
- the version of the resourcepublic java.net.URL getLocation()
public long getLastUpdated()
public void setLastUpdated(long updatedTime)
updatedTime
- the time (in ms) to be set as last updated timepublic long getRemoteContentLength()
public void setRemoteContentLength(long length)
public void setJnlpPath(java.lang.String jnlpPath)
public long getLastModified()
public void setLastModified(long modifyTime)
public boolean isCurrent(long lastModified)
lastModified
- - current time as get from server (in ms). Mostly value of "Last-Modified" http header'?public boolean isCurrent(long lastModified, java.io.File cachedFile)
public boolean isCached()
public boolean isCached(java.io.File cachedFile)
protected boolean store()
public void markForDelete()
protected void lock()
protected void unlock()
protected boolean tryLock()
protected boolean isHeldByCurrentThread()
public java.io.File getLocalFile()