Class CacheEntry

java.lang.Object
org.xmlresolver.cache.CacheEntry

public class CacheEntry extends Object
An entry in the cache. Each entry in the cache is represented by a CacheEntry object that identifies the URI, local file, and other details about the entry. This object represents the data, the actual cached resource. It contains a pointer back to the XML Catalog entry for the resource.
  • Field Details

    • entry

      public final Entry entry
      The XML Catalog entry for this cached resource.
    • uri

      public final URI uri
      The URI of the resource.
    • file

      public final File file
      The local file where this resource is cached.
    • time

      public final long time
      The date when the resource was cached.
    • expired

      public boolean expired
      Is this resource expired?
  • Constructor Details

    • CacheEntry

      protected CacheEntry(EntryUri entry, long time)
      Cache a URI.
      Parameters:
      entry - the catalog entry
      time - the timestamp.
    • CacheEntry

      protected CacheEntry(EntrySystem entry, long time)
      Cache a system entry.
      Parameters:
      entry - the catalog entry
      time - the timestamp.
    • CacheEntry

      protected CacheEntry(EntryPublic entry, long time)
      Cache a public entry.
      Parameters:
      entry - the catalog entry
      time - the timestamp.
  • Method Details

    • etag

      public String etag()
      The resource etag. See https://en.wikipedia.org/wiki/HTTP_ETag
      Returns:
      The resource etag, or null if no etag is available.
    • contentType

      public String contentType()
      The resource content type.
      Returns:
      The content type, or null if the content type is unknown.
    • location

      public URI location()
      The location If the resource was redirected, this method returns the redirected location.
      Returns:
      The redirected location or the original URI if no redirection occurred.
    • toString

      public String toString()
      A string representation for the entry.
      Overrides:
      toString in class Object