org.springframework.web.filter
Class ShallowEtagHeaderFilter.ShallowEtagResponseWrapper

java.lang.Object
  extended by HttpServletResponseWrapper
      extended by org.springframework.web.filter.ShallowEtagHeaderFilter.ShallowEtagResponseWrapper
Enclosing class:
ShallowEtagHeaderFilter

private static class ShallowEtagHeaderFilter.ShallowEtagResponseWrapper
extends HttpServletResponseWrapper

HttpServletRequest wrapper that buffers all content written to the output stream and writer, and allows this content to be retrieved via a byte array.


Nested Class Summary
private  class ShallowEtagHeaderFilter.ShallowEtagResponseWrapper.ResponsePrintWriter
           
private  class ShallowEtagHeaderFilter.ShallowEtagResponseWrapper.ResponseServletOutputStream
           
 
Field Summary
private  java.io.ByteArrayOutputStream content
           
private  ServletOutputStream outputStream
           
private  int statusCode
           
private  java.io.PrintWriter writer
           
 
Constructor Summary
private ShallowEtagHeaderFilter.ShallowEtagResponseWrapper(HttpServletResponse response)
           
 
Method Summary
 ServletOutputStream getOutputStream()
           
private  int getStatusCode()
           
 java.io.PrintWriter getWriter()
           
 void reset()
           
 void resetBuffer()
           
 void sendError(int sc)
           
 void sendError(int sc, java.lang.String msg)
           
 void setContentLength(int len)
           
 void setStatus(int sc)
           
 void setStatus(int sc, java.lang.String sm)
           
private  byte[] toByteArray()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

content

private final java.io.ByteArrayOutputStream content

outputStream

private final ServletOutputStream outputStream

writer

private java.io.PrintWriter writer

statusCode

private int statusCode
Constructor Detail

ShallowEtagHeaderFilter.ShallowEtagResponseWrapper

private ShallowEtagHeaderFilter.ShallowEtagResponseWrapper(HttpServletResponse response)
Method Detail

setStatus

public void setStatus(int sc)

setStatus

public void setStatus(int sc,
                      java.lang.String sm)

sendError

public void sendError(int sc)
               throws java.io.IOException
Throws:
java.io.IOException

sendError

public void sendError(int sc,
                      java.lang.String msg)
               throws java.io.IOException
Throws:
java.io.IOException

setContentLength

public void setContentLength(int len)

getOutputStream

public ServletOutputStream getOutputStream()

getWriter

public java.io.PrintWriter getWriter()
                              throws java.io.IOException
Throws:
java.io.IOException

resetBuffer

public void resetBuffer()

reset

public void reset()

getStatusCode

private int getStatusCode()

toByteArray

private byte[] toByteArray()