Top Description Inners Fields Constructors Methods
org.apache.catalina.webresources

public Class CachedResource

extends Object
implements WebResource
Class Inheritance
All Implemented Interfaces
org.apache.catalina.WebResource
Imports
java.io.ByteArrayInputStream, .IOException, .InputStream, java.net.JarURLConnection, .MalformedURLException, .URI, .URISyntaxException, .URL, .URLConnection, .URLStreamHandler, java.nio.charset.Charset, java.security.Permission, java.security.cert.Certificate, java.text.Collator, java.util.Arrays, .Locale, java.util.jar.JarFile, .Manifest, org.apache.catalina.WebResource, .WebResourceRoot, org.apache.juli.logging.Log, .LogFactory, org.apache.tomcat.util.res.StringManager

This class is designed to wrap a 'raw' WebResource and providing caching for expensive operations. Inexpensive operations may be passed through to the underlying resource.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private static class
CachedResource.CachedResourceURLStreamHandler

URLStreamHandler to handle a URL for a cached resource, delegating reads to the Cache.

Field Summary

Modifier and TypeField and Description
private final Cache
private static final long
private volatile byte[]
private volatile Long
private volatile Boolean
private volatile Boolean
private volatile Boolean
private volatile Boolean
private volatile Long
private volatile String
private static final Log
private volatile long
private final int
private final StandardRoot
private static final StringManager
private final long
private final boolean
private final String
private volatile WebResource
private volatile WebResource[]

Constructor Summary

AccessConstructor and Description
public
CachedResource(Cache cache, StandardRoot root, String path, long ttl, int objectMaxSizeBytes, boolean usesClassLoaderResources)

Method Summary

Modifier and TypeMethod and Description
private static InputStream
public boolean
public boolean
public boolean
public String
public Certificate[]
public URL
public byte[]
public long
public long
public String
getETag()

Implements org.apache.catalina.WebResource.getETag.

Return the strong ETag if available (currently not supported) else return the weak ETag calculated from the content length and last modified.

public InputStream
getInputStream()

Implements org.apache.catalina.WebResource.getInputStream.

Obtain an InputStream based on the contents of this resource.

public long
public String
public Manifest
public String
public String
protected long
pack-priv long
public URL
public String
pack-priv WebResource
public WebResourceRoot
pack-priv WebResource[]
public boolean
public boolean
public boolean
isVirtual()

Implements org.apache.catalina.WebResource.isVirtual.

Indicates if this resource is required for applications to correctly scan the file structure but that does not exist in either the main or any additional WebResourceSet.

public void
setMimeType(String
The mime type that will be associated with the resource
mimeType
)

Implements org.apache.catalina.WebResource.setMimeType.

Set the MIME type for this Resource.

pack-priv boolean
protected boolean
validateResource(boolean useClassLoaderResources)

protected boolean
validateResources(boolean useClassLoaderResources)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait