public SvnAuthenticationManager getManager(final AuthManagerType type, final SvnVcs vcs) { if (AuthManagerType.active.equals(type)) { return getInteractiveManager(vcs); } else if (AuthManagerType.passive.equals(type)) { return getPassiveAuthenticationManager(vcs.getProject()); } else if (AuthManagerType.usual.equals(type)) { return getAuthenticationManager(vcs); } throw new IllegalArgumentException(); }
public SvnAuthenticationManager getInteractiveManager(final SvnVcs svnVcs) { if (myInteractiveManager == null) { myInteractiveManager = new SvnAuthenticationManager(svnVcs.getProject(), new File(getConfigurationDirectory())); myInteractiveManager.setRuntimeStorage(RUNTIME_AUTH_CACHE); myInteractiveProvider = new SvnInteractiveAuthenticationProvider(svnVcs, myInteractiveManager); myInteractiveManager.setAuthenticationProvider(myInteractiveProvider); } return myInteractiveManager; }
public SvnAuthenticationManager getAuthenticationManager(final SvnVcs svnVcs) { if (myAuthManager == null) { // reloaded when configuration directory changes myAuthManager = new SvnAuthenticationManager(svnVcs.getProject(), new File(getConfigurationDirectory())); Disposer.register( svnVcs.getProject(), new Disposable() { @Override public void dispose() { myAuthManager = null; } }); getInteractiveManager(svnVcs); // to init myAuthManager.setAuthenticationProvider( new SvnAuthenticationProvider(svnVcs, myInteractiveProvider, RUNTIME_AUTH_CACHE)); myAuthManager.setRuntimeStorage(RUNTIME_AUTH_CACHE); } return myAuthManager; }