// 2) DefaultSVNAuthenticationManager returns the username and password we set below
// 3) if the authentication is successful, lib.svnkit calls back acknowledgeAuthentication
// (so we store the password info here)
repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(url));
repository.setTunnelProvider( createDefaultSVNOptions() );
AuthenticationManagerImpl authManager = upc.new AuthenticationManagerImpl(logWriter) {
@Override
protected void onSuccess(String realm, Credential cred) {
LOGGER.info("Persisted "+cred+" for "+realm);
credentials.put(realm, cred);
save();
if (upc.inContextOf!=null)
new PerJobCredentialStore(upc.inContextOf).acknowledgeAuthentication(realm,cred);
}
};
authManager.setAuthenticationForced(true);
repository.setAuthenticationManager(authManager);
repository.testConnection();
authManager.checkIfProtocolCompleted();
} finally {
if (repository != null)
repository.closeSession();
}
}