public RequestLine getRequestLine() { String method = getMethod(); ProtocolVersion ver = getProtocolVersion(); URI uri = getURI(); String uritext = null; if (uri != null) { uritext = uri.toASCIIString(); } if (uritext == null || uritext.length() == 0) { uritext = "/"; } return new BasicRequestLine(method, uritext, ver); }
/** * 获取协议版本信息 * * @return */ public ProtocolVersion getProtocolVersion(){ return request.getProtocolVersion(); }
public String getProtocolVersion() { String ver = null; if(request != null) { ver = request.getProtocolVersion().toString(); } return ver; }
@Override public RequestLine getRequestLine() { final String method = getMethod(); final ProtocolVersion ver = getProtocolVersion(); final URI uriCopy = getURI(); // avoids possible window where URI could be changed String uritext = null; if (uriCopy != null) { uritext = uriCopy.toASCIIString(); } if (uritext == null || uritext.isEmpty()) { uritext = "/"; } return new BasicRequestLine(method, uritext, ver); }
public RequestLine getRequestLine() { String method = getMethod(); ProtocolVersion ver = getProtocolVersion(); URI uri = getURI(); String uritext = null; if (uri != null) { uritext = uri.toASCIIString(); } if (uritext == null || uritext.length() == 0) { uritext = "/"; } return new BasicRequestLine(method, uritext, ver); }
@Override public String toString() { return getMethod() + " " + getURI() + " " + getProtocolVersion(); }
@Override public RequestLine getRequestLine() { final String method = getMethod(); final ProtocolVersion ver = getProtocolVersion(); final URI uriCopy = getURI(); // avoids possible window where URI could be changed String uritext = null; if (uriCopy != null) { uritext = uriCopy.toASCIIString(); } if (uritext == null || uritext.isEmpty()) { uritext = "/"; } return new BasicRequestLine(method, uritext, ver); }
@Override public String toString() { return getMethod() + " " + getURI() + " " + getProtocolVersion(); }
public RequestLine getRequestLine() { String method = getMethod(); ProtocolVersion ver = getProtocolVersion(); URI uri = getURI(); String uritext = null; if (uri != null) { uritext = uri.toASCIIString(); } if (uritext == null || uritext.length() == 0) { uritext = "/"; } return new BasicRequestLine(method, uritext, ver); }
@Override public String toString() { return getMethod() + " " + getURI() + " " + getProtocolVersion(); }
@Override public String toString() { return getMethod() + " " + getURI() + " " + getProtocolVersion(); }
@Override public String toString() { return getMethod() + " " + getURI() + " " + getProtocolVersion(); }
public RequestLine getRequestLine() { String method = getMethod(); ProtocolVersion ver = getProtocolVersion(); URI uri = getURI(); String uritext = null; if (uri != null) { uritext = uri.toASCIIString(); } if (uritext == null || uritext.length() == 0) { uritext = "/"; } return new BasicRequestLine(method, uritext, ver); }
public RequestLine getRequestLine() { final String method = getMethod(); final ProtocolVersion ver = getProtocolVersion(); final URI uri = getURI(); String uritext = null; if (uri != null) { uritext = uri.toASCIIString(); } if (uritext == null || uritext.length() == 0) { uritext = "/"; } return new BasicRequestLine(method, uritext, ver); }
@Override public RequestLine getRequestLine() { final String method = getMethod(); final ProtocolVersion ver = getProtocolVersion(); final URI uriCopy = getURI(); // avoids possible window where URI could be changed String uritext = null; if (uriCopy != null) { uritext = uriCopy.toASCIIString(); } if (uritext == null || uritext.isEmpty()) { uritext = "/"; } return new BasicRequestLine(method, uritext, ver); }
@Override public String toString() { return getMethod() + " " + getURI() + " " + getProtocolVersion(); }
public RequestLine getRequestLine() { String method = getMethod(); ProtocolVersion ver = getProtocolVersion(); URI uri = getURI(); String uritext = null; if (uri != null) { uritext = uri.toASCIIString(); } if (uritext == null || uritext.length() == 0) { uritext = "/"; } return new BasicRequestLine(method, uritext, ver); }
@Override public RequestLine getRequestLine() { final String method = getMethod(); final ProtocolVersion ver = getProtocolVersion(); final URI uriCopy = getURI(); // avoids possible window where URI could be changed String uritext = null; if (uriCopy != null) { uritext = uriCopy.toASCIIString(); } if (uritext == null || uritext.isEmpty()) { uritext = "/"; } return new BasicRequestLine(method, uritext, ver); }
@Override public RequestLine getRequestLine() { final String method = getMethod(); final ProtocolVersion ver = getProtocolVersion(); final URI uriCopy = getURI(); // avoids possible window where URI could be changed String uritext = null; if (uriCopy != null) { uritext = uriCopy.toASCIIString(); } if (uritext == null || uritext.isEmpty()) { uritext = "/"; } return new BasicRequestLine(method, uritext, ver); }
} catch (IOException e) { LOGGER.debug("Problem processing request:", e); BasicHttpResponse response = new BasicHttpResponse(method.getProtocolVersion(), HttpStatus.INTERNAL_SERVER_ERROR_500, e.getMessage()); response.setEntity(EntityBuilder.create().setText(e.getClass() + ": " + e.getMessage()).setContentEncoding(MediaType.TEXT_PLAIN).build()); return new EmissaryResponse(response);