URL getUrl;
try {
getUrl = RDFUtils.iriToUrl(uri);
} catch (MalformedURLException e) {
throw new RippleException(e);
}
method = HTTPUtils.createGetMethod(getUrl.toString());
HTTPUtils.setAcceptHeader(method, acceptHeader);
idleTime = HTTPUtils.throttleHttpRequest(method);
HttpClient client = HTTPUtils.createClient();
HttpResponse response;
try {
response = client.execute(method);
} catch (IOException e) {
throw new RippleException(e);
}
InputStream is;
int code = response.getStatusLine().getStatusCode();
if (2 != code / 100) {
throw new ErrorResponseException("" + code + " response for resource <"
+ StringUtils.escapeURIString(uri) + ">");
}
try {
is = response.getEntity().getContent();
} catch (IOException e) {
throw new RippleException(e);
}
inputStream = new HttpRepresentationInputStream(is);
Header h = response.getFirstHeader(HTTPUtils.CONTENT_TYPE);