/** * Set the request URI * * @param uri * new request URI * @see #setRequestURI(String) * @deprecated */ @Deprecated public void setURI(String uri) { setRequestURI(uri); }
/** * @param uri * an absolute URI (for example 'http://localhost/foo/bar?a=1') */ public void setURI(URI uri) { if (!uri.isAbsolute()) throw new IllegalArgumentException("!Absolute URI: " + uri); if (uri.isOpaque()) throw new IllegalArgumentException("Opaque URI: " + uri); if (LOG.isDebugEnabled()) LOG.debug("URI = {}",uri.toASCIIString()); String scheme = uri.getScheme(); int port = uri.getPort(); if (port <= 0) port = "https".equalsIgnoreCase(scheme)?443:80; setScheme(scheme); setAddress(new Address(uri.getHost(),port)); HttpURI httpUri = new HttpURI(uri); String completePath = httpUri.getCompletePath(); setRequestURI(completePath == null?"/":completePath); }
_exchange.setRequestURI(_location);