|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectat.spardat.xma.boot.cache.FCResource
class: FCResource ( File Cached Resource )
Describes an entry in the file-cache.
| Field Summary | |
protected byte[] |
buffer_
byte array for buffered mode |
protected boolean |
debug
extended readable file output |
protected java.io.File |
file_
resource file |
protected java.net.URL |
location_
the remote resource location |
protected PropertyFile |
properties_
info-file about the cached file |
| Constructor Summary | |
protected |
FCResource(java.net.URL location,
java.io.File file,
boolean bmode,
boolean debug)
Create a FCResource for the resources specified as a remote URL. |
| Method Summary | |
long |
getExpiration()
Gets the expiration date of this resource. |
java.io.InputStream |
getInputStream()
Gets an input stream from this resource |
long |
getLastModified()
Last-Modified is the http-header value used to check, if a resource is still up to date. |
long |
getLastUpdated()
Returns the time in the local system clock that the file was most recently checked for an update. |
java.net.URL |
getLocalRes()
get an url to the local resource |
java.net.URL |
getLocation()
Returns the remote location this entry caches. |
java.lang.String |
getProperty(java.lang.String key)
Returns the value of the specified key, or null if the key does not exist. |
java.lang.String |
getProperty(java.lang.String key,
java.lang.String defaultValue)
Returns the value of the specified key, or the default value if the key does not exist. |
boolean |
isExpired()
is this resource still up to date |
protected void |
loadBuffer()
load data from resource file into memory buffer |
void |
setExpiration(long lExpires)
Sets the expiration date of this resource. |
void |
setLastModified(long lastModified)
Sets the value of the last modified header in the resource description file. |
void |
setLastUpdated(long updatedTime)
Sets the time in the local system clock that the file was most recently checked for an update. |
void |
setProperty(java.lang.String string,
long l)
Sets the named property to the given value. |
java.lang.Object |
setProperty(java.lang.String key,
java.lang.String value)
Sets the value for the specified key. |
protected void |
store()
Saves the current information for the cache entry. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.net.URL location_
protected PropertyFile properties_
protected java.io.File file_
protected byte[] buffer_
protected boolean debug
| Constructor Detail |
protected FCResource(java.net.URL location,
java.io.File file,
boolean bmode,
boolean debug)
throws java.io.IOException
Create a FCResource for the resources specified as a remote URL.
it is protected, because a resource must not be created by others than the FileCache
If the file does not exist, it will not be created.
location - the remote resource locationfile - the resource filebmode - buffer mode
java.io.IOException - containing the filename
java.lang.IllegalArgumentException - the file must exist already| Method Detail |
protected void loadBuffer()
throws java.io.IOException
java.io.IOException - containing the filenamepublic java.net.URL getLocation()
getLocation in interface IFileCacheResource
protected void store()
throws java.io.IOException
java.io.IOException - containing the filename
public java.io.InputStream getInputStream()
throws java.io.IOException
IFileCacheResource
getInputStream in interface IFileCacheResourcejava.io.IOException - containing the filenameIFileCacheResourcepublic java.lang.String getProperty(java.lang.String key)
getProperty in interface IFileCacheResourcekey - key to look for
public java.lang.String getProperty(java.lang.String key,
java.lang.String defaultValue)
getProperty in interface IFileCacheResource
public java.lang.Object setProperty(java.lang.String key,
java.lang.String value)
setProperty in interface IFileCacheResourcepublic long getLastUpdated()
getLastUpdated in interface IFileCacheResourcepublic void setLastUpdated(long updatedTime)
public long getLastModified()
IFileCacheResource
getLastModified in interface IFileCacheResourcepublic void setLastModified(long lastModified)
lastModified - in milliseconds since 1.1.1970public void setExpiration(long lExpires)
IFileCacheResource
setExpiration in interface IFileCacheResourcelExpires - expiration date/time
public long getExpiration()
IFileCacheResource
getExpiration in interface IFileCacheResource
public void setProperty(java.lang.String string,
long l)
IFileCacheResource
setProperty in interface IFileCacheResourcestring - name of the propertyl - of the propertypublic java.net.URL getLocalRes()
IFileCacheResource
getLocalRes in interface IFileCacheResourcepublic boolean isExpired()
IFileCacheResource
isExpired in interface IFileCacheResource
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||