/** * @param name * @param value * @see org.mortbay.jetty.HttpFields#putLongField(java.lang.String, long) */ public void setLongHeader(String name, long value) { _fields.putLongField(name,value); }
public void setIntHeader(String name, int value) { if (!_connection.isIncluding()) { _connection.getResponseFields().putLongField(name, value); if (HttpHeaders.CONTENT_LENGTH.equalsIgnoreCase(name)) _connection._generator.setContentLength(value); } }
public void setLongContentLength(long len) { // Protect from setting after committed as default handling // of a servlet HEAD request ALWAYS sets _content length, even // if the getHandling committed the response! if (isCommitted() || _connection.isIncluding()) return; _connection._generator.setContentLength(len); _connection.getResponseFields().putLongField(HttpHeaders.CONTENT_LENGTH, len); }
fields.putLongField(HttpHeaders.CONTENT_LENGTH_BUFFER,length);
public void setContentLength(int len) { // Protect from setting after committed as default handling // of a servlet HEAD request ALWAYS sets _content length, even // if the getHandling committed the response! if (isCommitted() || _connection.isIncluding()) return; _connection._generator.setContentLength(len); if (len>=0) { _connection.getResponseFields().putLongField(HttpHeaders.CONTENT_LENGTH, len); if (_connection._generator.isContentWritten()) { if (_outputState==WRITER) _writer.close(); else if (_outputState==STREAM) { try { getOutputStream().close(); } catch(IOException e) { throw new RuntimeException(e); } } } } }
_responseFields.add(HttpHeaders.CONTENT_TYPE_BUFFER, c.getContentType()); if (c.getContentLength() > 0) _responseFields.putLongField(HttpHeaders.CONTENT_LENGTH_BUFFER, c.getContentLength()); Buffer lm = c.getLastModified(); long lml=c.getResource().lastModified();