Package org.xmlresolver.cache
Class CacheEntry
- java.lang.Object
-
- org.xmlresolver.cache.CacheEntry
-
public class CacheEntry extends java.lang.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 Summary
Fields Modifier and Type Field Description Entry
entry
The XML Catalog entry for this cached resource.boolean
expired
Is this resource expired?java.io.File
file
The local file where this resource is cached.long
time
The date when the resource was cached.java.net.URI
uri
The URI of the resource.
-
Constructor Summary
Constructors Modifier Constructor Description protected
CacheEntry(EntryPublic entry, long time)
Cache a public entry.protected
CacheEntry(EntrySystem entry, long time)
Cache a system entry.protected
CacheEntry(EntryUri entry, long time)
Cache a URI.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
contentType()
The resource content type.java.lang.String
etag()
The resource etag.java.net.URI
location()
The location If the resource was redirected, this method returns the redirected location.java.lang.String
toString()
A string representation for the entry.
-
-
-
Field Detail
-
entry
public final Entry entry
The XML Catalog entry for this cached resource.
-
uri
public final java.net.URI uri
The URI of the resource.
-
file
public final java.io.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 Detail
-
CacheEntry
protected CacheEntry(EntryUri entry, long time)
Cache a URI.- Parameters:
entry
- the catalog entrytime
- the timestamp.
-
CacheEntry
protected CacheEntry(EntrySystem entry, long time)
Cache a system entry.- Parameters:
entry
- the catalog entrytime
- the timestamp.
-
CacheEntry
protected CacheEntry(EntryPublic entry, long time)
Cache a public entry.- Parameters:
entry
- the catalog entrytime
- the timestamp.
-
-
Method Detail
-
etag
public java.lang.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 java.lang.String contentType()
The resource content type.- Returns:
- The content type, or null if the content type is unknown.
-
location
public java.net.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 java.lang.String toString()
A string representation for the entry.- Overrides:
toString
in classjava.lang.Object
-
-