/** * @param name * @param value * @throws IllegalArgumentException * @see org.mortbay.jetty.HttpFields#add(java.lang.String, java.lang.String) */ public void addHeader(String name, String value) throws IllegalArgumentException { _fields.add(name,value); }
public void parsedHeader(Buffer name, Buffer value) throws IOException { _fields.add(name,value); }
/** * Add to or set a field. If the field is allowed to have multiple values, add will add multiple * headers of the same name. * * @param name the name of the field * @param value the value of the field. * @exception IllegalArgumentException If the name is a single valued field and already has a * value. */ public void add(Buffer name, Buffer value) throws IllegalArgumentException { add(name, value, -1); }
/** * Sets the value of an long field. * * @param name the field name * @param value the field long value */ public void addLongField(Buffer name, long value) { Buffer v = BufferUtil.toBuffer(value); add(name, v, value); }
/** * Add fields from another HttpFields instance. Single valued fields are replaced, while all * others are added. * * @param fields */ public void add(HttpFields fields) { if (fields == null) return; Enumeration e = fields.getFieldNames(); while (e.hasMoreElements()) { String name = (String) e.nextElement(); Enumeration values = fields.getValues(name); while (values.hasMoreElements()) add(name, (String) values.nextElement()); } }
public void addHeader(String name, String value) { if (!_connection.isIncluding()) { _connection.getResponseFields().add(name, value); if (HttpHeaders.CONTENT_LENGTH.equalsIgnoreCase(name)) _connection._generator.setContentLength(Long.parseLong(value)); } }
/** * Sets the value of an long field. * * @param name the field name * @param value the field long value */ public void addLongField(String name, long value) { Buffer n = HttpHeaders.CACHE.lookup(name); Buffer v = BufferUtil.toBuffer(value); add(n, v, value); }
/** * Sets the value of a date field. * * @param name the field name * @param date the field date value */ public void addDateField(String 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 n = HttpHeaders.CACHE.lookup(name); Buffer v = new ByteArrayBuffer(_dateBuffer.toString()); add(n, v, date); }
/** * Add to or set a field. If the field is allowed to have multiple values, add will add multiple * headers of the same name. * * @param name the name of the field * @param value the value of the field. * @exception IllegalArgumentException If the name is a single valued field and already has a * value. */ public void add(String name, String value) throws IllegalArgumentException { Buffer n = HttpHeaders.CACHE.lookup(name); Buffer v = HttpHeaderValues.CACHE.lookup(value); add(n, v, -1); }
add(HttpHeaders.SET_COOKIE_BUFFER, new ByteArrayBuffer(name_value_params));
_responseFields.add(HttpHeaders.CONTENT_TYPE_BUFFER, c.getContentType()); if (c.getContentLength() > 0) _responseFields.putLongField(HttpHeaders.CONTENT_LENGTH_BUFFER, c.getContentLength());