dispatcher.setDownloader("http", URLHandlerRegistry.getHttp(getRealm(), getHost(), getUsername(), getPasswd()));
URLHandler httpHandler = URLHandlerRegistry.getHttp(getRealm(), getHost(), getUsername(), getPasswd()); dispatcher.setDownloader("http", httpHandler); dispatcher.setDownloader("https", httpHandler);
    private void configureURLHandler() {        URLHandlerDispatcher dispatcher = new URLHandlerDispatcher();        dispatcher.setDownloader("http", URLHandlerRegistry.getHttp(getRealm(), getHost(), getUsername(), getPasswd()));        URLHandlerRegistry.setDefault(dispatcher);    }