List of usage examples for org.apache.commons.httpclient URI getProtocolCharset
public String getProtocolCharset()
From source file:edu.ucsd.xmlrpc.xmlrpc.client.XmlRpcCommonsTransport.java
protected void resetClientForRedirect() throws XmlRpcException { //get the location header to find out where to redirect to Header locationHeader = method.getResponseHeader("location"); if (locationHeader == null) { throw new XmlRpcException("Invalid redirect: Missing location header"); }//from www. ja v a 2s .c o m String location = locationHeader.getValue(); URI redirectUri = null; URI currentUri = null; try { currentUri = method.getURI(); String charset = currentUri.getProtocolCharset(); redirectUri = new URI(location, true, charset); method.setURI(redirectUri); } catch (URIException ex) { throw new XmlRpcException(ex.getMessage(), ex); } //And finally invalidate the actual authentication scheme method.getHostAuthState().invalidate(); }
From source file:pl.nask.hsn2.NewUrlObject.java
private String getHost(URI uri) { if (!uri.getProtocolCharset().equals("UTF-8")) { LOG.warn("Encoding should be set to UTF-8"); return null; }// w w w . j a v a2 s . c o m return new String(uri.getRawHost()); }