/** * @param name * @param value * @see org.mortbay.jetty.HttpFields#put(java.lang.String, java.lang.String) */ public void setHeader(String name, String value) { _fields.put(name,value); }
fields.put(HttpHeaders.CACHE_CONTROL_BUFFER,_cacheControl);
long lml=c.getResource().lastModified(); if (lm != null) _responseFields.put(HttpHeaders.LAST_MODIFIED_BUFFER, lm,lml); else if (c.getResource()!=null)
/** * Set a field. * * @param name the name of the field * @param value the value of the field. If null the field is cleared. */ public void put(Buffer name, Buffer value) { put(name, value, -1); }
/** * Sets the value of an long field. * * @param name the field name * @param value the field long value */ public void putLongField(Buffer name, long value) { Buffer v = BufferUtil.toBuffer(value); put(name, v, value); }
/** * Set a field. * * @param name the name of the field * @param value the value of the field. If null the field is cleared. */ public void put(Buffer name, String value) { Buffer v = HttpHeaderValues.CACHE.lookup(value); put(name, v, -1); }
public void setContentType(String contentType) { _connection.getRequestFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,contentType); }
/** * Sets the value of a date field. * * @param name the field name * @param date the field date value */ public void putDateField(Buffer name, long date) { if (_dateBuffer == null) { _dateBuffer = new StringBuffer(32); _calendar = new GregorianCalendar(__GMT); } _dateBuffer.setLength(0); _calendar.setTimeInMillis(date); formatDate(_dateBuffer, _calendar, false); Buffer v = new ByteArrayBuffer(_dateBuffer.toString()); put(name, v, date); }
public String toString() { try { ByteArrayBuffer buffer = new ByteArrayBuffer(4096); put(buffer); return BufferUtil.to8859_1_String(buffer); } catch (Exception e) { e.printStackTrace(); } return null; }
/** * Sets the value of an long field. * * @param name the field name * @param value the field long value */ public void putLongField(String name, long value) { Buffer n = HttpHeaders.CACHE.lookup(name); Buffer v = BufferUtil.toBuffer(value); put(n, v, value); }
protected boolean setContentEncodingGzip() { HttpConnection connection = HttpConnection.getCurrentConnection(); connection.getResponseFields().put("Content-Encoding", "gzip"); return true; }
/** * Set a field. * * @param name the name of the field * @param value the value of the field. If null the field is cleared. */ public void put(String name, String value) { Buffer n = HttpHeaders.CACHE.lookup(name); Buffer v = null; if (value != null) v = HttpHeaderValues.CACHE.lookup(value); put(n, v, -1); }
/** * Set a field. * * @param name the name of the field * @param list the List value of the field. If null the field is cleared. */ public void put(String name, List list) { if (list == null || list.size() == 0) { remove(name); return; } Buffer n = HttpHeaders.CACHE.lookup(name); Object v = list.get(0); if (v != null) put(n, HttpHeaderValues.CACHE.lookup(v.toString())); else remove(n); if (list.size() > 1) { java.util.Iterator iter = list.iterator(); iter.next(); while (iter.hasNext()) { v = iter.next(); if (v != null) put(n, HttpHeaderValues.CACHE.lookup(v.toString())); } } }
public void setHeader(String name, String value) { if (!_connection.isIncluding()) { _connection.getResponseFields().put(name, value); if (HttpHeaders.CONTENT_LENGTH.equalsIgnoreCase(name)) { if (value==null) _connection._generator.setContentLength(-1); else _connection._generator.setContentLength(Long.parseLong(value)); } } }
_connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_cachedMimeType); else _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_mimeType); _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,content_type); _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType); _contentType=_contentType.substring(0,i8)+QuotedStringTokenizer.quote(_characterEncoding,";= ")+_contentType.substring(i2); _connection.getResponseFields().put(HttpHeaders.CONTENT_TYPE_BUFFER,_contentType);
response_fields.put(HttpHeaders.CONNECTION_BUFFER,HttpHeaderValues.CLOSE_BUFFER); break; response_fields.put(HttpHeaders.CONNECTION_BUFFER,HttpHeaderValues.KEEP_ALIVE); break; case HttpHeaderValues.TE_ORDINAL: response_fields.put(HttpHeaders.CONNECTION_BUFFER,HttpHeaderValues.TE); break; response_fields.put(HttpHeaders.DATE_BUFFER, request.getTimeStampBuffer(),request.getTimeStamp());