private void commitClose() throws IOException { if (!isCommitted) { isCommitted = true; o = responseWriter.writeStatusAndHeaders(-1, ContainerResponse.this); } } }
public OutputStream writeStatusAndHeaders(long contentLength, ContainerResponse response) throws IOException { gos = new GZIPOutputStream(crw.writeStatusAndHeaders(-1, response)); return gos; }
public OutputStream writeStatusAndHeaders(long contentLength, ContainerResponse response) throws IOException { ti.addTraceHeaders(); return crw.writeStatusAndHeaders(contentLength, response); }
public OutputStream writeStatusAndHeaders(long contentLength, ContainerResponse response) throws IOException { printResponseLine(b, response); printResponseHeaders(b, response.getHttpHeaders()); if (disableEntity) { logger.info(b.toString()); return crw.writeStatusAndHeaders(contentLength, response); } else { this.contentLength = contentLength; this.response = response; return this.baos = new ByteArrayOutputStream(); } }
public void finish() throws IOException { if (!disableEntity) { byte[] entity = baos.toByteArray(); printEntity(b, entity); // Output to log logger.info(b.toString()); // Write out the headers and buffered entity OutputStream out = crw.writeStatusAndHeaders(contentLength, response); out.write(entity); } crw.finish(); } }
/** * Handle HTTP HEAD method (headers, ..) during writing a response. * * @param size size of a response entity. * @throws IOException if an error occurred when writing out the status and headers or obtaining the output stream. */ private void writeHttpHead(final long size) throws IOException { if (size != -1) { getHttpHeaders().putSingle(HttpHeaders.CONTENT_LENGTH, Long.toString(size)); } isCommitted = true; responseWriter.writeStatusAndHeaders(size, this); // Close the InputStream if the entity is an instance of this type. if (entity instanceof InputStream) { ((InputStream)entity).close(); } }
private void commitWrite() throws IOException { if (!isCommitted) { if (getStatus() == 204) setStatus(200); isCommitted = true; o = responseWriter.writeStatusAndHeaders(size, ContainerResponse.this); } }
responseWriter.writeStatusAndHeaders(-1, this); responseWriter.finish(); return; responseWriter.writeStatusAndHeaders(-1, this);
private void commitClose() throws IOException { if (!isCommitted) { isCommitted = true; o = responseWriter.writeStatusAndHeaders(-1, ContainerResponse.this); } } }
private void commitClose() throws IOException { if (!isCommitted) { isCommitted = true; o = responseWriter.writeStatusAndHeaders(-1, ContainerResponse.this); } } }
public OutputStream writeStatusAndHeaders(long contentLength, ContainerResponse response) throws IOException { return crw.writeStatusAndHeaders(contentLength, response); }
public OutputStream writeStatusAndHeaders(long contentLength, ContainerResponse response) throws IOException { gos = new GZIPOutputStream(crw.writeStatusAndHeaders(-1, response)); return gos; }
public OutputStream writeStatusAndHeaders(long contentLength, ContainerResponse response) throws IOException { ti.addTraceHeaders(); return crw.writeStatusAndHeaders(contentLength, response); }
public OutputStream writeStatusAndHeaders(long contentLength, ContainerResponse response) throws IOException { // set the header to application/javascript response.getHttpHeaders().putSingle(CONTENT_TYPE, APPLICATION_JAVASCRIPT_TYPE); out = containerResponseWriter.writeStatusAndHeaders(-1, response); out.write((callbackFunction + "(").getBytes()); return out; }
public OutputStream writeStatusAndHeaders(long contentLength, ContainerResponse response) throws IOException { printResponseLine(b, response); printResponseHeaders(b, response.getHttpHeaders()); if (disableEntity) { logger.info(b.toString()); return crw.writeStatusAndHeaders(contentLength, response); } else { this.contentLength = contentLength; this.response = response; return this.baos = new ByteArrayOutputStream(); } }
public void finish() throws IOException { if (!disableEntity) { byte[] entity = baos.toByteArray(); printEntity(b, entity); // Output to log logger.info(b.toString()); // Write out the headers and buffered entity OutputStream out = crw.writeStatusAndHeaders(contentLength, response); out.write(entity); } crw.finish(); } }
public OutputStream writeStatusAndHeaders(long contentLength, ContainerResponse response) throws IOException { printResponseLine(b, response); printResponseHeaders(b, response.getHttpHeaders()); if (disableEntity) { logger.info(b.toString()); return crw.writeStatusAndHeaders(contentLength, response); } else { this.contentLength = contentLength; this.response = response; return this.baos = new ByteArrayOutputStream(); } }
public OutputStream writeStatusAndHeaders(long contentLength, ContainerResponse response) throws IOException { ti.addTraceHeaders(); return crw.writeStatusAndHeaders(contentLength, response); }
private void commitWrite() throws IOException { if (!isCommitted) { if (getStatus() == 204) setStatus(200); isCommitted = true; o = responseWriter.writeStatusAndHeaders(size, ContainerResponse.this); } }
private void commitWrite() throws IOException { if (!isCommitted) { if (getStatus() == 204) setStatus(200); isCommitted = true; o = responseWriter.writeStatusAndHeaders(size, ContainerResponse.this); } }