public interface WritableCachedResponse extends CacheResponse
Modifier and Type | Method and Description |
---|---|
void |
addHeader(String pName,
String pValue)
Adds a header key/value pair for this response.
|
com.twelvemonkeys.servlet.cache.CachedResponse |
getCachedResponse()
Returns the final (immutable)
CachedResponse created by this
WritableCachedResponse . |
String[] |
getHeaderNames()
Gets the header names of all headers set in this response.
|
String |
getHeaderValue(String pHeaderName)
Gets the first header value set for the given header in this response.
|
String[] |
getHeaderValues(String pHeaderName)
Gets all header values set for the given header in this response.
|
OutputStream |
getOutputStream()
Gets the
OutputStream for this cached response. |
int |
getStatus() |
void |
setHeader(String pName,
String pValue)
Sets a header key/value pair for this response.
|
int |
size()
Returns the size of this cached response in bytes.
|
void |
writeContentsTo(OutputStream pStream)
Writes the cahced content to the response
|
void |
writeHeadersTo(CacheResponse pResponse)
Writes the cached headers to the response
|
getHeaders, getStatus, setStatus
OutputStream getOutputStream()
OutputStream
for this cached response.
This allows a client to write to the cached response.getOutputStream
in interface CacheResponse
OutputStream
for this response.void setHeader(String pName, String pValue)
setHeader
in interface CacheResponse
pName
- the header namepValue
- the header valueaddHeader(String, String)
void addHeader(String pName, String pValue)
addHeader
in interface CacheResponse
pName
- the header namepValue
- the header valuesetHeader(String, String)
com.twelvemonkeys.servlet.cache.CachedResponse getCachedResponse()
CachedResponse
created by this
WritableCachedResponse
.CachedResponse
void writeHeadersTo(CacheResponse pResponse)
pResponse
- the servlet responsevoid writeContentsTo(OutputStream pStream) throws IOException
pStream
- the response output streamIOException
- if an I/O exception occurs during writeint getStatus()
String[] getHeaderNames()
String
sString[] getHeaderValues(String pHeaderName)
null
is returned.pHeaderName
- the header nameString
s, or null
if there is no
such header in this response.String getHeaderValue(String pHeaderName)
null
is returned.
Useful for headers that don't have multiple values, like
"Content-Type"
or "Content-Length"
.pHeaderName
- the header nameString
, or null
if there is no
such header in this response.int size()
Copyright © 2017. All rights reserved.