/** * Creates a new instance of this class using the provided {@link ISVNOptions} * driver and user's credentials to make a default implementation of * {@link org.tmatesoft.svn.core.auth.ISVNAuthenticationManager} use them. * That means this <b>SVNClientManager</b> will use the caller's configuration options * (which correspond to options found in the default SVN's <i>config</i> * file), the default SVN's <i>servers</i> configuration and the caller's * credentials. * * @param options a config driver * @param userName a user account name * @param password a user password * @return a new <b>SVNClientManager</b> instance */ public static SVNClientManager newInstance(ISVNOptions options, String userName, String password) { boolean storeAuth = options == null ? true : options.isAuthStorageEnabled(); ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(null, userName, password, storeAuth); return new SVNClientManager(options, authManager); }
/** * Creates a default authentication manager that uses the provided * configuration directory and user's credentials. Whether * the default auth storage is used or not depends on the 'store-auth-creds'</i> * option that is looked up in the <i>config</i> file under the * <i>[auth]</i> section. Files <i>config</i> and <i>servers</i> will * be created (if they still don't exist) in the specified directory * (they are the same as those ones you can find in the default SVN's * run-time configuration area). * * @param configDir a new location of the run-time configuration * area * @param userName a user's name * @param password a user's password * @return a default implementation of the credentials * and servers configuration driver interface */ public static ISVNAuthenticationManager createDefaultAuthenticationManager(File configDir, String userName, String password) { ISVNOptions options = createDefaultOptions(configDir, true); boolean store = options.isAuthStorageEnabled(); return createDefaultAuthenticationManager(configDir, userName, password, store); }
private void updateClientManager() { File configDir = myConfigDir == null ? null : new File(myConfigDir); myOptions = SVNWCUtil.createDefaultOptions(configDir, true); myAuthenticationManager = SVNWCUtil.createDefaultAuthenticationManager(configDir, myUserName, myPassword, myOptions.isAuthStorageEnabled()); if (myPrompt != null) { myAuthenticationManager.setAuthenticationProvider(new JavaHLAuthenticationProvider(myPrompt)); } else { myAuthenticationManager.setAuthenticationProvider(null); } myAuthenticationManager.setRuntimeStorage(ourAuthStorage); myClientManager = null; }