Package org.apache.velocity.tools.view
Class ImportSupport.ImportResponseWrapper
java.lang.Object
HttpServletResponseWrapper
org.apache.velocity.tools.view.ImportSupport.ImportResponseWrapper
- Enclosing class:
- ImportSupport
protected static class ImportSupport.ImportResponseWrapper
extends HttpServletResponseWrapper
Wraps responses to allow us to retrieve results as Strings.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ByteArrayOutputStreamA buffer, alternatively, to accumulate bytes.private boolean'True if getOutputStream() was called; false otherwise.private boolean'True' if getWriter() was called; false otherwise.private intThe HTTP status set by the target.private StringWriterThe Writer we convey. -
Constructor Summary
ConstructorsConstructorDescriptionImportResponseWrapper(HttpServletResponse response) Constructs a new ImportResponseWrapper. -
Method Summary
Modifier and TypeMethodDescriptionServletOutputStreamintRetrieves the buffered output, using the containing tag's 'charEncoding' attribute, or the tag's default encoding, if necessary.voidHas no effect.voidHas no effect.voidsetStatus(int status) Sets the status of the response
-
Field Details
-
sw
The Writer we convey. -
bos
A buffer, alternatively, to accumulate bytes. -
isWriterUsed
private boolean isWriterUsed'True' if getWriter() was called; false otherwise. -
isStreamUsed
private boolean isStreamUsed'True if getOutputStream() was called; false otherwise. -
status
private int statusThe HTTP status set by the target.
-
-
Constructor Details
-
ImportResponseWrapper
public ImportResponseWrapper(HttpServletResponse response) Constructs a new ImportResponseWrapper.- Parameters:
response- the response to wrap
-
-
Method Details
-
getWriter
- Returns:
- a Writer designed to buffer the output.
-
getOutputStream
public ServletOutputStream getOutputStream()- Returns:
- a ServletOutputStream designed to buffer the output.
-
setContentType
Has no effect. -
setLocale
Has no effect. -
setStatus
public void setStatus(int status) Sets the status of the response- Parameters:
status- the status code
-
getStatus
public int getStatus()- Returns:
- the status of the response
-
getString
Retrieves the buffered output, using the containing tag's 'charEncoding' attribute, or the tag's default encoding, if necessary.- Returns:
- the buffered output
- Throws:
UnsupportedEncodingException- if the encoding is not supported
-