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

The following examples show how to use org.tigris.subversion.svnclientadapter.ISVNClientAdapter#setConfigDirectory() . 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: SVNClientManager.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
/**
 * @param configDir The configDir to set.
 */
public void setConfigDir(File configDir) {
	this.configDir = configDir;
	if (cachedClients == null) return;
	
	// Update configDir in stored clients
	Set<String> keys = cachedClients.keySet();
	for (String key : keys) {
		ISVNClientAdapter svnClient = cachedClients.get(key);
		if (svnClient != null) {
			try {
				svnClient.setConfigDirectory(configDir);
			} catch (SVNClientException e) {
				break;
			}
		}
	}
}
 
Example 2
Source File: SvnClientFactory.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void setConfigDir (ISVNClientAdapter client) {
    if (client != null) {
        File configDir = FileUtil.normalizeFile(new File(SvnConfigFiles.getNBConfigPath()));
        try {
            client.setConfigDirectory(configDir);
        } catch (SVNClientException ex) {
            // not interested, just log
            LOG.log(Level.INFO, null, ex);
        }
    }
}
 
Example 3
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 4
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();
}