String url = domain+uri.toString();
GetMethod getMethod = new GetMethod(url);
getMethod.setDoAuthentication(true);
HttpState httpState = new HttpState();
httpState.setCredentials(null, host, credentials);
int state = getMethod.execute(httpState, new HttpConnection(host, port, protocol));
if ( state != HttpStatus.SC_OK ) {
return null;
}
InputStream stream = getMethod.getResponseBodyAsStream();
String contentType = getMethod.getResponseHeader("Content-type").getValue();