@Override public boolean containsValue(Object value) { if (value instanceof String) { MessageBytes needle = MessageBytes.newInstance(); needle.setString((String) value); for (int i = 0; i < this.headers.size(); i++) { if (this.headers.getValue(i).equals(needle)) { return true; } } } return false; }
@Override public boolean containsValue(Object value) { if (value instanceof String) { MessageBytes needle = MessageBytes.newInstance(); needle.setString((String) value); for (int i = 0; i < this.headers.size(); i++) { if (this.headers.getValue(i).equals(needle)) { return true; } } } return false; }
private static HttpHeaders convertResponse(Response coyoteRes) { final HttpHeaders headers = HttpHeaders.of(HttpStatus.valueOf(coyoteRes.getStatus())); final String contentType = coyoteRes.getContentType(); if (contentType != null && !contentType.isEmpty()) { headers.set(HttpHeaderNames.CONTENT_TYPE, contentType); } final long contentLength = coyoteRes.getBytesWritten(true); // 'true' will trigger flush. final String method = coyoteRes.getRequest().method().toString(); if (!"HEAD".equals(method)) { headers.setLong(HttpHeaderNames.CONTENT_LENGTH, contentLength); } final MimeHeaders cHeaders = coyoteRes.getMimeHeaders(); final int numHeaders = cHeaders.size(); for (int i = 0; i < numHeaders; i++) { final AsciiString name = toHeaderName(cHeaders.getName(i)); if (name == null) { continue; } final String value = toHeaderValue(cHeaders.getValue(i)); if (value == null) { continue; } headers.add(name.toLowerCase(), value); } return headers; }
public MessageBytes contentType() { if (contentTypeMB == null) { contentTypeMB = headers.getValue("content-type"); } return contentTypeMB; }
public MessageBytes contentType() { if (contentTypeMB == null) contentTypeMB = headers.getValue("content-type"); return contentTypeMB; }
public MessageBytes contentType() { if (contentTypeMB == null) contentTypeMB = headers.getValue("content-type"); return contentTypeMB; }
public MessageBytes contentType() { if (contentTypeMB == null) contentTypeMB = headers.getValue("content-type"); return contentTypeMB; }
public MessageBytes contentType() { if (contentTypeMB == null) { contentTypeMB = headers.getValue("content-type"); } return contentTypeMB; }
public MessageBytes contentType() { if (contentTypeMB == null) contentTypeMB = headers.getValue("content-type"); return contentTypeMB; }
private boolean isConnectionClose(MimeHeaders headers) { MessageBytes connection = headers.getValue(Constants.CONNECTION); if (connection == null) { return false; } return connection.equals(Constants.CLOSE); }
private boolean isConnectionClose(MimeHeaders headers) { MessageBytes connection = headers.getValue(Constants.CONNECTION); if (connection == null) { return false; } return connection.equals(Constants.CLOSE); }
/* */ public String getHeader(String name) /* */ { /* 318 */ MessageBytes mh = getValue(name); /* 319 */ return mh != null ? mh.toString() : null; /* */ } /* */
private boolean isConnectionClose(MimeHeaders headers) { MessageBytes connection = headers.getValue(Constants.CONNECTION); if (connection == null) { return false; } return connection.equals(Constants.CLOSE); }
private boolean isConnectionClose(MimeHeaders headers) { MessageBytes connection = headers.getValue(Constants.CONNECTION); if (connection == null) { return false; } return connection.equals(Constants.CLOSE); }
private static boolean isConnectionClose(MimeHeaders headers) { MessageBytes connection = headers.getValue(Constants.CONNECTION); if (connection == null) { return false; } return connection.equals(Constants.CLOSE); }
private void findNext() { next = null; for (; pos < size; pos++) { MessageBytes n1 = getName(pos); if (n1.equalsIgnoreCase(name)) { next = getValue(pos); break; } } pos++; }
private void findNext() { next=null; for(; pos< size; pos++ ) { MessageBytes n1=headers.getName( pos ); if( n1.equalsIgnoreCase( name )) { next=headers.getValue( pos ); break; } } pos++; }
private void findNext() { next=null; for(; pos< size; pos++ ) { MessageBytes n1=headers.getName( pos ); if( n1.equalsIgnoreCase( name )) { next=headers.getValue( pos ); break; } } pos++; }
private void findNext() { next = null; for (; pos < size; pos++) { MessageBytes n1 = getName(pos); if (n1.equalsIgnoreCase(name)) { next = getValue(pos); break; } } pos++; }
void fillInHeaders(OperationList headers, MimeHeaders rawHeaders) { for (int i = 0; i < rawHeaders.size(); i++) { String name = rawHeaders.getName(i).getString(); String value = rawHeaders.getValue(i).getString(); headers.createMap().put("name", name).put("value", value); } }