public HostMeta getHostMeta(String host) throws HostMetaException {
try {
URI uri = getHostMetaUriForHost(host);
FetchRequest request = FetchRequest.createGetRequest(uri);
FetchResponse response = fetcher.fetch(request);
int status = response.getStatusCode();
if (status != HttpStatus.SC_OK) {
throw new HttpResponseException(status, "fetching host-meta from " +
host + " return status " + status);
}
return HostMeta.parseFromStream(response.getContentAsStream());
} catch (FetchException e) {
throw new HostMetaException(e);
} catch (URISyntaxException e) {
throw new HostMetaException(e);