Class CachedFile

  • All Implemented Interfaces:
    ResourceInfo

    class CachedFile
    extends java.lang.Object
    implements ResourceInfo
    Describes an entry in the cache.
    Version:
    $Revision: 1.10 $
    • Constructor Summary

      Constructors 
      Constructor Description
      CachedFile​(CacheIndexEntry lruEntry, java.io.File cacheFile, java.io.File infoFile)  
      CachedFile​(CacheKey key, java.io.File cacheFile, java.io.File infoFile)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) java.io.File getCacheFile()  
      CacheKey getCacheKey()  
      long getDownloadedAt()
      Returns the time in the local system clock that the file was most recently checked for an update.
      (package private) java.lang.String getJnlpPath()  
      long getLastModified()  
      private long getLongKey​(java.lang.String key)  
      long getSize()  
      (package private) boolean isCached()
      Returns true if the cache has a local copy of the resource.
      (package private) boolean isCurrent​(long lastModified)
      Returns whether there is a version of the URL contents in the cache and it is up to date.
      (package private) boolean isFile()  
      private void setLongKey​(java.lang.String key, long value)  
      (package private) void storeInfo​(long downloadedAt, long lastModified, long size)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • CachedFile

        CachedFile​(CacheIndexEntry lruEntry,
                   java.io.File cacheFile,
                   java.io.File infoFile)
      • CachedFile

        CachedFile​(CacheKey key,
                   java.io.File cacheFile,
                   java.io.File infoFile)
    • Method Detail

      • getDownloadedAt

        public long getDownloadedAt()
        Returns the time in the local system clock that the file was most recently checked for an update.
        Specified by:
        getDownloadedAt in interface ResourceInfo
        Returns:
        when the item was updated (in ms)
      • getSize

        public long getSize()
        Specified by:
        getSize in interface ResourceInfo
        Returns:
        the size of the resource in bytes
      • getLastModified

        public long getLastModified()
        Specified by:
        getLastModified in interface ResourceInfo
        Returns:
        the last time this resource was modified (in Java millis)
      • getJnlpPath

        java.lang.String getJnlpPath()
      • getCacheFile

        java.io.File getCacheFile()
      • getLongKey

        private long getLongKey​(java.lang.String key)
      • setLongKey

        private void setLongKey​(java.lang.String key,
                                long value)
      • 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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object