connection.setInstanceFollowRedirects(false);
connection.connect();
count++;
if (count > 10) {
throw new ComponentRegistryException("Too many redirect");
}
}
InputStream inputStream = connection.getInputStream();
InputStreamReader reader = new InputStreamReader(inputStream);
HtmlRegistryParserCallback callback = new HtmlRegistryParserCallback();
ParserDelegator parser = new ParserDelegator();
parser.parse(reader, callback, false);
} catch (IOException e) {
throw new ComponentRegistryException(e);
}
}