public void close() throws IOException { flush(); printWriter.close(); }
public void close() throws IOException { flush(); printWriter.close(); }
public void close() throws IOException { flush(); printWriter.close(); }
private void clearWriter() throws IOException { if(null == response) { this.writer = new StringWriter(); printWriter = new PrintWriter(writer); } else { flush(); response.resetBuffer(); } }
/** * Returns the output or an empty string, if * an output <code>Writer</code> was provided * in the constructor. * @return the output or an empty string */ public String getOutputAsString() { try { flush(); if(!providedWriter) { return ((StringWriter)writer).toString(); } return ""; } catch(IOException exc) { throw new NestedApplicationException(exc); } }
/** * Returns the output or an empty string, if * an output <code>Writer</code> was provided * in the constructor. * @return the output or an empty string */ public String getOutputAsString() { try { flush(); if(!providedWriter) { return ((StringWriter)writer).toString(); } return ""; } catch(IOException exc) { throw new NestedApplicationException(exc); } }
/** * Returns the output. * @return the output */ public String getOutputAsString() { try { flush(); if(!providedWriter) { if(null == response) { return writer.toString(); } if(response instanceof MockHttpServletResponse) { return ((MockHttpServletResponse)response).getOutputStreamContent(); } } return ""; } catch(IOException exc) { throw new NestedApplicationException(exc); } }