@Override public void add(String key, @Nullable String value) { this.headers.addValue(key).setString(value); }
@Override public void set(String key, @Nullable String value) { this.headers.setValue(key).setString(value); }
@Override @Nullable public List<String> put(String key, List<String> value) { List<String> previousValues = get(key); this.headers.removeHeader(key); value.forEach(v -> this.headers.addValue(key).setString(v)); return previousValues; }
@Override public void set(String key, @Nullable String value) { this.headers.setValue(key).setString(value); }
@Override public void add(String key, @Nullable String value) { this.headers.addValue(key).setString(value); }
@Override @Nullable public List<String> put(String key, List<String> value) { List<String> previousValues = get(key); this.headers.removeHeader(key); value.forEach(v -> this.headers.addValue(key).setString(v)); return previousValues; }
@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; }
final Request coyoteReq = new Request(); coyoteReq.scheme().setString(req.scheme()); coyoteReq.remoteAddr().setString(remoteAddr.getAddress().getHostAddress()); coyoteReq.remoteHost().setString(remoteAddr.getHostString()); coyoteReq.setRemotePort(remoteAddr.getPort()); coyoteReq.localAddr().setString(localAddr.getAddress().getHostAddress()); coyoteReq.localName().setString(hostName()); coyoteReq.setLocalPort(localAddr.getPort()); final int colonPos = hostHeader.indexOf(':'); if (colonPos < 0) { coyoteReq.serverName().setString(hostHeader); } else { coyoteReq.serverName().setString(hostHeader.substring(0, colonPos)); try { final int port = Integer.parseInt(hostHeader.substring(colonPos + 1)); coyoteReq.method().setString(method.name()); coyoteReq.queryString().setString(ctx.query());
/** * Set the path information for this Request. This will normally be called * when the associated Context is mapping the Request to a particular * Wrapper. * * @param path The path information */ public void setPathInfo(String path) { mappingData.pathInfo.setString(path); }
/** * Set the path information for this Request. This will normally be called * when the associated Context is mapping the Request to a particular * Wrapper. * * @param path The path information */ public void setPathInfo(String path) { mappingData.pathInfo.setString(path); }
/** * Set the servlet path for this Request. This will normally be called * when the associated Context is mapping the Request to a particular * Wrapper. * * @param path The servlet path */ public void setServletPath(String path) { if (path != null) mappingData.wrapperPath.setString(path); }
/** * Set the servlet path for this Request. This will normally be called * when the associated Context is mapping the Request to a particular * Wrapper. * * @param path The servlet path */ public void setServletPath(String path) { if (path != null) mappingData.wrapperPath.setString(path); }
/** * Set the path information for this Request. This will normally be called * when the associated Context is mapping the Request to a particular * Wrapper. * * @param path The path information */ public void setPathInfo(String path) { mappingData.pathInfo.setString(path); }
/** * Set the servlet path for this Request. This will normally be called * when the associated Context is mapping the Request to a particular * Wrapper. * * @param path The servlet path */ public void setServletPath(String path) { if (path != null) mappingData.wrapperPath.setString(path); }
/** * Exact mapping. */ private final void internalMapExactWrapper (Wrapper[] wrappers, CharChunk path, MappingData mappingData) { int pos = find(wrappers, path); if ((pos != -1) && (path.equals(wrappers[pos].name))) { mappingData.requestPath.setString(wrappers[pos].name); mappingData.wrapperPath.setString(wrappers[pos].name); mappingData.wrapper = wrappers[pos].object; } }
public void setHeader(String name, String value) { char cc=name.charAt(0); if( cc=='C' || cc=='c' ) { if( checkSpecialHeader(name, value) ) return; } headers.setValue(name).setString( value); }
public void setHeader(String name, String value) { char cc=name.charAt(0); if( cc=='C' || cc=='c' ) { if( checkSpecialHeader(name, value) ) return; } headers.setValue(name).setString( value); }
public void addHeader(String name, String value) { char cc=name.charAt(0); if( cc=='C' || cc=='c' ) { if( checkSpecialHeader(name, value) ) return; } headers.addValue(name).setString( value ); }
/** Create a new named header , return the MessageBytes container for the new value */ public MessageBytes addValue(String name) { MimeHeaderField mh = createHeader(); mh.getName().setString(name); return mh.getValue(); }