try {
lockStreams();
outputStream = super.getOutputStream();
}
catch (IOException e) {
throw new RewriteException("Could not get response output stream.", e);
}
}
if (isResponseStreamWrapped())
{
if (wrappedOutputStream == null)
{
HttpServletRewrite event = new HttpBufferRewriteImpl(request, this, servletContext);
try {
OutputStream wrapped = super.getOutputStream();
for (ResponseStreamWrapper wrapper : responseStreamWrappers) {
wrapped = wrapper.wrap(event, wrapped);
}
wrappedOutputStream = new RewriteServletOutputStream(wrapped);
if (!isResponseContentIntercepted())
{
outputStream = wrappedOutputStream;
}
}
catch (IOException e) {
throw new RewriteException("Could not get response output stream.", e);
}
}
}
}