private void authenticate(final Proxy proxy, final Session session, final Cache<Path> cache, final CancelCallback callback) throws BackgroundException { if(!login.authenticate(proxy, session, listener, prompt, callback)) { if(session.isConnected()) { // Next attempt with updated credentials this.authenticate(proxy, session, cache, callback); } else { // Reconnect and next attempt with updated credentials this.connect(session, cache, callback); } } } }
this.authenticate(proxy, session, cache, callback);