private static void configureURLHandler(String realm, String host, String username,
String passwd) {
CredentialsStore.INSTANCE.addCredentials(realm, host, username, passwd);
URLHandlerDispatcher dispatcher = new URLHandlerDispatcher();
URLHandler httpHandler = URLHandlerRegistry.getHttp();
dispatcher.setDownloader("http", httpHandler);
dispatcher.setDownloader("https", httpHandler);
URLHandlerRegistry.setDefault(dispatcher);
}