Class CachedFile
java.lang.Object
net.adoptopenjdk.icedteaweb.resources.cache.CachedFile
- All Implemented Interfaces:
ResourceInfo
Describes an entry in the cache.
- Version:
- $Revision: 1.10 $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Filethe cache file(package private) static final Stringprivate final CacheKeyprivate static final String(package private) static final Stringprivate static final Stringprivate static final Stringprivate static final Loggerprivate final PropertiesFileinfo about the cached file -
Constructor Summary
ConstructorsConstructorDescriptionCachedFile(CacheIndexEntry lruEntry, File cacheFile, File infoFile) CachedFile(CacheKey key, File cacheFile, File infoFile) -
Method Summary
Modifier and TypeMethodDescription(package private) FilelongReturns the time in the local system clock that the file was most recently checked for an update.(package private) Stringlongprivate longgetLongKey(String key) longgetSize()(package private) booleanisCached()Returns true if the cache has a local copy of the resource.(package private) booleanisCurrent(long lastModified) Returns whether there is a version of the URL contents in the cache and it is up to date.(package private) booleanisFile()private voidsetLongKey(String key, long value) (package private) voidstoreInfo(long downloadedAt, long lastModified, long size) toString()
-
Field Details
-
LOG
-
INFO_SUFFIX
- See Also:
-
KEY_SIZE
- See Also:
-
KEY_LAST_MODIFIED
- See Also:
-
KEY_DOWNLOADED_AT
- See Also:
-
KEY_JNLP_PATH
- See Also:
-
key
-
cacheFile
the cache file -
properties
info about the cached file
-
-
Constructor Details
-
CachedFile
CachedFile(CacheIndexEntry lruEntry, File cacheFile, File infoFile) -
CachedFile
-
-
Method Details
-
getCacheKey
- Specified by:
getCacheKeyin interfaceResourceInfo- Returns:
- the cache key of the resource
-
getDownloadedAt
public long getDownloadedAt()Returns the time in the local system clock that the file was most recently checked for an update.- Specified by:
getDownloadedAtin interfaceResourceInfo- Returns:
- when the item was updated (in ms)
-
getSize
public long getSize()- Specified by:
getSizein interfaceResourceInfo- Returns:
- the size of the resource in bytes
-
getLastModified
public long getLastModified()- Specified by:
getLastModifiedin interfaceResourceInfo- Returns:
- the last time this resource was modified (in Java millis)
-
getJnlpPath
String getJnlpPath() -
getCacheFile
File getCacheFile() -
getLongKey
-
setLongKey
-
isFile
boolean isFile() -
isCurrent
boolean isCurrent(long lastModified) Returns whether there is a version of the URL contents in the cache and it is up to date.- Parameters:
lastModified- - current time as get from server (in ms). Mostly value of "Last-Modified" http header'?- Returns:
- whether the cache contains the version
-
isCached
boolean isCached()Returns true if the cache has a local copy of the resource.- Returns:
- true if the resource is in the cache
-
storeInfo
void storeInfo(long downloadedAt, long lastModified, long size) -
toString
-