protected SVNRepository getRepository(Item context, SVNURL repoURL, StandardCredentials credentials, Map<String, Credentials> additionalCredentials, ISVNSession session) throws SVNException { SVNRepository repository = SVNRepositoryFactory.create(repoURL, session); ISVNAuthenticationManager sam = createSvnAuthenticationManager( new CredentialsSVNAuthenticationProviderImpl(credentials, additionalCredentials, /* TODO */ TaskListener.NULL) ); sam = new FilterSVNAuthenticationManager(sam) { // If there's no time out, the blocking read operation may hang forever, because TCP itself // has no timeout. So always use some time out. If the underlying implementation gives us some // value (which may come from ~/.subversion), honor that, as long as it sets some timeout value. @Override public int getReadTimeout(SVNRepository repository) { int r = super.getReadTimeout(repository); if(r<=0) r = DEFAULT_TIMEOUT; return r; } }; repository.setTunnelProvider(createDefaultSVNOptions()); repository.setAuthenticationManager(sam); return repository; }
protected SVNRepository getRepository(SVNURL repoURL, StandardCredentials credentials, Map<String, Credentials> additionalCredentials, ISVNSession session) throws SVNException { SVNRepository repository = SVNRepositoryFactory.create(repoURL, session); ISVNAuthenticationManager sam = SubversionSCM.createSvnAuthenticationManager( new CredentialsSVNAuthenticationProviderImpl(credentials, additionalCredentials, /* TODO */ TaskListener.NULL) ); sam = new FilterSVNAuthenticationManager(sam) { // If there's no time out, the blocking read operation may hang forever, because TCP itself // has no timeout. So always use some time out. If the underlying implementation gives us some // value (which may come from ~/.subversion), honor that, as long as it sets some timeout value. @Override public int getReadTimeout(SVNRepository repository) { int r = super.getReadTimeout(repository); if(r<=0) r = SubversionSCM.DEFAULT_TIMEOUT; return r; } }; repository.setTunnelProvider(SubversionSCM.createDefaultSVNOptions()); repository.setAuthenticationManager(sam); return repository; }
try { repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(scmURL)); repository.setTunnelProvider(SVNWCUtil.createDefaultOptions(true)); }catch(SVNException e){ LOGGER.throwing(SVNRepositoryFactory.class.getName(), "create", e);
repository.setTunnelProvider(SVNWCUtil.createDefaultOptions(true)); repository.setAuthenticationManager(sam);
private SVNRepository getSourceRepository() throws SVNException { if (mySourceRepository == null) { mySourceRepository = SVNRepositoryFactory.create(myRepos.getLocation()); mySourceRepository.setAuthenticationManager(myRepos.getAuthenticationManager()); mySourceRepository.setDebugLog(myRepos.getDebugLog()); mySourceRepository.setTunnelProvider(myRepos.getTunnelProvider()); mySourceRepository.setCanceller(myRepos.getCanceller()); } return mySourceRepository; }
repos = SVNRepositoryFactory.create(url, this); repos.setAuthenticationManager(myAuthManager); repos.setTunnelProvider(myTunnelProvider); repos.setDebugLog(myDebugLog); repos.setCanceller(myCanceller); repos.setTunnelProvider(myTunnelProvider); repos.setDebugLog(myDebugLog); repos.setCanceller(myCanceller);
repos = SVNRepositoryFactory.create(url, this); repos.setAuthenticationManager(myAuthManager); repos.setTunnelProvider(myTunnelProvider); repos.setDebugLog(myDebugLog); repos.setCanceller(myCanceller); repos.setTunnelProvider(myTunnelProvider); repos.setDebugLog(myDebugLog); repos.setCanceller(myCanceller);
repos = SVNRepositoryFactory.create(url, this); repos.setAuthenticationManager(myAuthManager); repos.setTunnelProvider(myTunnelProvider); return repos; repos.setTunnelProvider(myTunnelProvider);
private SVNRepository getSourceRepository() throws SVNException { if (mySourceRepository == null) { mySourceRepository = SVNRepositoryFactory.create(myRepos.getLocation()); mySourceRepository.setAuthenticationManager(myRepos.getAuthenticationManager()); mySourceRepository.setDebugLog(myRepos.getDebugLog()); mySourceRepository.setTunnelProvider(myRepos.getTunnelProvider()); mySourceRepository.setCanceller(myRepos.getCanceller()); } return mySourceRepository; }
private SVNRepository getSourceRepository() throws SVNException { if (mySourceRepository == null) { mySourceRepository = SVNRepositoryFactory.create(myRepos.getLocation()); mySourceRepository.setAuthenticationManager(myRepos.getAuthenticationManager()); mySourceRepository.setDebugLog(myRepos.getDebugLog()); mySourceRepository.setTunnelProvider(myRepos.getTunnelProvider()); mySourceRepository.setCanceller(myRepos.getCanceller()); } return mySourceRepository; }
repos = SVNRepositoryFactory.create(url, this); repos.setAuthenticationManager(myAuthManager); repos.setTunnelProvider(myTunnelProvider); repos.setDebugLog(myDebugLog); repos.setCanceller(myCanceller); repos.setTunnelProvider(myTunnelProvider); repos.setDebugLog(myDebugLog); repos.setCanceller(myCanceller);
repository.setTunnelProvider(SVNWCUtil.createDefaultOptions(true)); AuthenticationManagerImpl authManager = upc.new AuthenticationManagerImpl(logWriter) { @Override
private SVNRepository createRepository(SVNURL repoURL, StandardCredentials credentials) throws SVNException { SVNRepository repository = null; repository = SVNRepositoryFactory.create(repoURL); File configDir = SVNWCUtil.getDefaultConfigurationDirectory(); ISVNAuthenticationManager sam = new SVNAuthenticationManager(configDir, null, null); sam.setAuthenticationProvider(new CredentialsSVNAuthenticationProviderImpl(credentials)); SVNAuthStoreHandlerImpl.install(sam); sam = new FilterSVNAuthenticationManager(sam) { // If there's no time out, the blocking read operation may hang forever, because TCP itself // has no timeout. So always use some time out. If the underlying implementation gives us some // value (which may come from ~/.subversion), honor that, as long as it sets some timeout value. @Override public int getReadTimeout(SVNRepository repository) { int r = super.getReadTimeout(repository); if (r <= 0) { r = (int) TimeUnit2.MINUTES.toMillis(1); } return r; } }; repository.setTunnelProvider(SVNWCUtil.createDefaultOptions(true)); repository.setAuthenticationManager(sam); return repository; } }
protected SVNRepository getRepository(AbstractProject context, SVNURL repoURL) throws SVNException { SVNRepository repository = SVNRepositoryFactory.create(repoURL); ISVNAuthenticationManager sam = SVNWCUtil.createDefaultAuthenticationManager(); sam = new FilterSVNAuthenticationManager(sam) { // If there's no time out, the blocking read operation may hang forever, because TCP itself // has no timeout. So always use some time out. If the underlying implementation gives us some // value (which may come from ~/.subversion), honor that, as long as it sets some timeout value. @Override public int getReadTimeout(SVNRepository repository) { int r = super.getReadTimeout(repository); if (r <= 0) { r = DEFAULT_TIMEOUT; } return r; } }; sam.setAuthenticationProvider(createAuthenticationProvider(context)); repository.setTunnelProvider(SVNWCUtil.createDefaultOptions(true)); repository.setAuthenticationManager(sam); return repository; }
protected SVNRepository getRepository(AbstractProject context, SVNURL repoURL) throws SVNException { SVNRepository repository = SVNRepositoryFactory.create(repoURL); ISVNAuthenticationManager sam = new DefaultSVNAuthenticationManager(); sam = new FilterSVNAuthenticationManager(sam) { // If there's no time out, the blocking read operation may hang forever, because TCP itself // has no timeout. So always use some time out. If the underlying implementation gives us some // value (which may come from ~/.subversion), honor that, as long as it sets some timeout value. @Override public int getReadTimeout(SVNRepository repository) { int r = super.getReadTimeout(repository); if (r <= 0) { r = DEFAULT_TIMEOUT; } return r; } }; sam.setAuthenticationProvider(createAuthenticationProvider(context)); repository.setTunnelProvider(SVNWCUtil.createDefaultOptions(true)); repository.setAuthenticationManager(sam.getAuthenticationManager()); return repository; }
/** * Submits the authentication info. * * This code is fairly ugly because of the way SVNKit handles credentials. */ public void postCredential(String url, final UserProvidedCredential upc, PrintWriter logWriter) throws SVNException, IOException { SVNRepository repository = null; try { // the way it works with SVNKit is that // 1) svnkit calls AuthenticationManager asking for a credential. // this is when we can see the 'realm', which identifies the user domain. // 2) DefaultSVNAuthenticationManager returns the username and password we set below // 3) if the authentication is successful, 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); authManager.setAuthenticationForced(true); repository.setAuthenticationManager(authManager); repository.testConnection(); authManager.checkIfProtocolCompleted(); } finally { if (repository != null) repository.closeSession(); } }
repository.setTunnelProvider(SVNWCUtil.createDefaultOptions(true)); AuthenticationManagerImpl authManager = upc.new AuthenticationManagerImpl(logWriter) { @Override