Java Code Examples for org.tigris.subversion.svnclientadapter.ISVNClientAdapter#addPasswordCallback()

The following examples show how to use org.tigris.subversion.svnclientadapter.ISVNClientAdapter#addPasswordCallback() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SvnClientFactory.java    From netbeans with Apache License 2.0 5 votes vote down vote up
protected void setupAdapter(ISVNClientAdapter adapter, String username, char[] password, ISVNPromptUserPassword callback) {
    adapter.setUsername(username);
    if(callback != null) {
        adapter.addPasswordCallback(callback);
    } else {
        // do not set password for javahl, it seems that in that case the password is stored permanently in ~/.subversion/auth
        adapter.setPassword(password == null ? "" : new String(password)); //NOI18N
    }
    try {
        File configDir = FileUtil.normalizeFile(new File(SvnConfigFiles.getNBConfigPath()));
        adapter.setConfigDirectory(configDir);
    } catch (SVNClientException ex) {
        SvnClientExceptionHandler.notifyException(ex, false, false);
    }
}
 
Example 2
Source File: SVNClientManager.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
private void setupClientAdapter(ISVNClientAdapter svnClient)
		throws SVNException {
	if (configDir != null) {
   		try {
			svnClient.setConfigDirectory(configDir);
		} catch (SVNClientException e) {
        	throw SVNException.wrapException(e);
		}
   	} 
   	if (SVNProviderPlugin.getPlugin().getSvnPromptUserPassword() != null)
   	    svnClient.addPasswordCallback(SVNProviderPlugin.getPlugin().getSvnPromptUserPassword());
   	if (svnAdminDir == null)
   		svnAdminDir = svnClient.getAdminDirectoryName();
}