com.sun.faces.application.resource
public class ResourceImpl extends javax.faces.application.Resource implements java.io.Externalizable
Resource
.
The ResourceImpl instance itself has the same lifespan as the
request, however, the ResourceInfo instances that back this object
are cached by the ResourceManager to reduce the time spent scanning
for resources.Modifier and Type | Field and Description |
---|---|
private static java.util.TimeZone |
GMT |
private static java.lang.String |
IF_MODIFIED_SINCE |
private long |
initialTime
Time when this application was started.
|
private static java.util.logging.Logger |
LOGGER |
private long |
maxAge
Lifespan of this resource for caching purposes.
|
private ResourceInfo |
resourceInfo |
private java.util.Map<java.lang.String,java.lang.String> |
responseHeaders |
private static java.lang.String |
RFC1123_DATE_PATTERN |
Constructor and Description |
---|
ResourceImpl()
Necessary for serialization.
|
ResourceImpl(ResourceInfo resourceInfo,
java.lang.String contentType,
long initialTime,
long maxAge)
Creates a new instance of ResourceBase
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
private long |
getIfModifiedHeader(javax.faces.context.ExternalContext extcontext) |
java.io.InputStream |
getInputStream() |
java.lang.String |
getRequestPath() |
java.util.Map<java.lang.String,java.lang.String> |
getResponseHeaders()
Implementation note.
|
java.net.URL |
getURL() |
int |
hashCode() |
private void |
initResourceInfo() |
private boolean |
isResourceRequest() |
void |
readExternal(java.io.ObjectInput in) |
boolean |
userAgentNeedsUpdate(javax.faces.context.FacesContext context) |
void |
writeExternal(java.io.ObjectOutput out) |
private static final java.util.logging.Logger LOGGER
private static final java.lang.String RFC1123_DATE_PATTERN
private static final java.lang.String IF_MODIFIED_SINCE
private static final java.util.TimeZone GMT
private transient ResourceInfo resourceInfo
private transient java.util.Map<java.lang.String,java.lang.String> responseHeaders
private long initialTime
private long maxAge
public ResourceImpl()
public ResourceImpl(ResourceInfo resourceInfo, java.lang.String contentType, long initialTime, long maxAge)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.io.InputStream getInputStream() throws java.io.IOException
getInputStream
in class javax.faces.application.Resource
java.io.IOException
Resource.getInputStream()
public java.net.URL getURL()
getURL
in class javax.faces.application.Resource
Resource.getURL()
public java.util.Map<java.lang.String,java.lang.String> getResponseHeaders()
Implementation note. Any values added to getResponseHeaders()
will only be visible across multiple calls to this method when
servicing a resource request (i.e. ResourceHandler.isResourceRequest(javax.faces.context.FacesContext)
returns true
). If we're not servicing a resource request,
an empty Map will be returned and the values added are effectively thrown
away.
getResponseHeaders
in class javax.faces.application.Resource
Resource.getResponseHeaders()
public java.lang.String getRequestPath()
getRequestPath
in class javax.faces.application.Resource
Resource.getRequestPath()
public boolean userAgentNeedsUpdate(javax.faces.context.FacesContext context)
userAgentNeedsUpdate
in class javax.faces.application.Resource
Resource.userAgentNeedsUpdate(javax.faces.context.FacesContext)
private long getIfModifiedHeader(javax.faces.context.ExternalContext extcontext)
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
private void initResourceInfo()
private boolean isResourceRequest()
Copyright © 2002-2010 Oracle America, Inc. All Rights Reserved.