当前位置: 首页>>代码示例>>Java>>正文


Java SVNWCUtil.createDefaultAuthenticationManager方法代码示例

本文整理汇总了Java中org.tmatesoft.svn.core.wc.SVNWCUtil.createDefaultAuthenticationManager方法的典型用法代码示例。如果您正苦于以下问题:Java SVNWCUtil.createDefaultAuthenticationManager方法的具体用法?Java SVNWCUtil.createDefaultAuthenticationManager怎么用?Java SVNWCUtil.createDefaultAuthenticationManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.tmatesoft.svn.core.wc.SVNWCUtil的用法示例。


在下文中一共展示了SVNWCUtil.createDefaultAuthenticationManager方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: connectToSVNInstance

import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的package包/类
public static SVNRepository connectToSVNInstance(String url, String usr,
		String pass) {
	SvnUtil.setupLibrary();
	SVNRepository repository = null;
	try {
		repository = SvnUtil.createRepository(url);
	} catch (SVNException svne) {
		System.err
				.println("error while creating an SVNRepository for location '"
						+ url + "': " + svne.getMessage());
	}

	ISVNAuthenticationManager authManager = SVNWCUtil
			.createDefaultAuthenticationManager(usr, pass);
	repository.setAuthenticationManager(authManager);

	try {
		SvnUtil.verifySVNLocation(repository, url);
	} catch (SVNException e) {
		e.printStackTrace();
	}

	return repository;
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:25,代码来源:SvnUtil.java

示例2: init

import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的package包/类
private void init() {
    logger.info("Creating MySVNClient for svn " + svn_url + ", username " + username + ", password " + password.replaceAll(".", "\\*"));

    DAVRepositoryFactory.setup( );
    SVNURL url;
    try {
        url = SVNURL.parseURIDecoded(svn_url);
        repository = SVNRepositoryFactory.create( url );

        ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager( username , password );
        repository.setAuthenticationManager( authManager );
    } catch (SVNException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:17,代码来源:MySVNClient.java

示例3: checkout

import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的package包/类
private File checkout(String scmUrl) throws Exception {
  ISVNOptions options = SVNWCUtil.createDefaultOptions(true);
  ISVNAuthenticationManager isvnAuthenticationManager = SVNWCUtil.createDefaultAuthenticationManager(null, null, (char[]) null, false);
  SVNClientManager svnClientManager = SVNClientManager.newInstance(options, isvnAuthenticationManager);
  File out = temp.newFolder();
  SVNUpdateClient updateClient = svnClientManager.getUpdateClient();
  SvnCheckout co = updateClient.getOperationsFactory().createCheckout();
  co.setUpdateLocksOnDemand(updateClient.isUpdateLocksOnDemand());
  co.setSource(SvnTarget.fromURL(SVNURL.parseURIEncoded(scmUrl), SVNRevision.HEAD));
  co.setSingleTarget(SvnTarget.fromFile(out));
  co.setRevision(SVNRevision.HEAD);
  co.setDepth(SVNDepth.INFINITY);
  co.setAllowUnversionedObstructions(false);
  co.setIgnoreExternals(updateClient.isIgnoreExternals());
  co.setExternalsHandler(SvnCodec.externalsHandler(updateClient.getExternalsHandler()));
  co.setTargetWorkingCopyFormat(wcVersion);
  co.run();
  return out;
}
 
开发者ID:SonarSource,项目名称:sonar-scm-svn,代码行数:20,代码来源:SvnTest.java

示例4: getCommits

import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的package包/类
@Override
public List<Commit> getCommits() {
	System.out.println("Getting commit log...");
	ISVNAuthenticationManager authManager = SVNWCUtil
			.createDefaultAuthenticationManager("guest", "");
	svn_client.setAuthenticationManager(authManager);
	SVNLogClient log_client = svn_client.getLogClient();
	try {
		log_client.doLog(SVN_url, new String[] { "" },
				SVNRevision.UNDEFINED, revision_range.getStartRevision(),
				revision_range.getEndRevision(), false, true, 0,
				log_handler);
	} catch (SVNException e) {
		e.printStackTrace();
	}
	return log_handler.getCommits();
}
 
开发者ID:aserg-ufmg,项目名称:ModularityCheck,代码行数:18,代码来源:SVNManager.java

示例5: getAuthManager

import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的package包/类
private ISVNAuthenticationManager getAuthManager()
{
    if ( getPrivateKey() != null )
    {
        SVNSSHAuthentication[] auth = new SVNSSHAuthentication[1];
        auth[0] = new SVNSSHAuthentication( getUser(), getPrivateKey().toCharArray(), getPassphrase(), -1, false );

        return new BasicAuthenticationManager( auth );
    }
    else if ( getUser() != null )
    {
        return new BasicAuthenticationManager( getUser(), getPassword() );
    }
    else
    {
        String configDirectory = SvnUtil.getSettings().getConfigDirectory();

        return SVNWCUtil.createDefaultAuthenticationManager(
            configDirectory == null ? null : new File( configDirectory ), getUser(), getPassword(),
            SvnUtil.getSettings().isUseAuthCache() );
    }
}
 
开发者ID:olamy,项目名称:maven-scm-provider-svnjava,代码行数:23,代码来源:SvnJavaScmProviderRepository.java

示例6: openRepository

import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的package包/类
private void openRepository() throws Exception {
		repository = null;
		try {
			repository = SVNRepositoryFactory.create(SVNURL
					.parseURIEncoded(this.url));
		} catch (SVNException svne) {
			logger.log(Level.WARNING,
					"error while creating an SVNRepository for the location '"
							+ this.url + "': " + svne.getMessage(), true);
//			StateBar.setState(Icons.ERROR, stateOpenRepositoryFailed);
			throw new Exception("Can't access svn!!!");
		}
		ISVNAuthenticationManager authManager = SVNWCUtil
				.createDefaultAuthenticationManager(name, password);
		repository.setAuthenticationManager(authManager);

	}
 
开发者ID:lazyzero,项目名称:kkMulticopterFlashTool,代码行数:18,代码来源:SVN.java

示例7: createRepository

import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的package包/类
/**
 * Set up repository. This method also determines the head revision of the
 * repository.
 * 
 * @throws ConQATException
 *             if setup fails.
 */
protected SVNRepository createRepository() throws ConQATException {
	DAVRepositoryFactory.setup();
	FSRepositoryFactory.setup();
	
	try {
		SVNRepository repository = SVNRepositoryFactory.create(SVNURL
				.parseURIEncoded(url));

		ISVNAuthenticationManager authManager;
		if (userName != null) {
			authManager = SVNWCUtil.createDefaultAuthenticationManager(
					userName, password);
		} else {
			authManager = SVNWCUtil.createDefaultAuthenticationManager();
		}
		repository.setAuthenticationManager(authManager);

		return repository;

	} catch (SVNException e) {
		throw new ConQATException(e);
	}
}
 
开发者ID:vimaier,项目名称:conqat,代码行数:31,代码来源:SVNProcessorBase.java

示例8: logModificacoesSVN

import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的package包/类
public void logModificacoesSVN() throws SVNException {

        ISVNAuthenticationManager aManager = SVNWCUtil.createDefaultAuthenticationManager("kann", senha_ic);

        SVNURL url = SVNURL.parseURIEncoded(SVN_PEIXE_ESPADA);
        SVNRepository repos = SVNRepositoryFactory.create(url);
        repos.setAuthenticationManager(aManager);

        long headRevision = repos.getLatestRevision();
        Collection<SVNDirEntry> entriesList = repos.getDir("", headRevision, null, (Collection) null);

        for (SVNDirEntry entry : entriesList) {
            System.out.println("Entrada: " + entry.getName());
            System.out.println("Última modificação da revisão: " + entry.getDate() +
                    " por " + entry.getAuthor());
            System.out.println("   --> MSG: "+entry.getCommitMessage());
        }
    }
 
开发者ID:gems-uff,项目名称:oceano,代码行数:19,代码来源:TesteSvnKit.java

示例9: init

import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的package包/类
/**
 * 접속정보 초기화
 *
 * @작성자 : KYJ
 * @작성일 : 2016. 5. 2.
 * @param properties
 */
public void init(Properties properties) {
	validate();

	try {
		svnURL = SVNURL.parseURIEncoded(getUrl());
		repository = SVNRepositoryFactory.create(svnURL);

		if ((getUserId() == null && getUserPassword() == null) || (getUserId().isEmpty() && getUserPassword().isEmpty())) {
			authManager = SVNWCUtil.createDefaultAuthenticationManager(SVNWCUtil.getDefaultConfigurationDirectory());
		} else {
			authManager = SVNWCUtil.createDefaultAuthenticationManager(getUserId(), getUserPassword().toCharArray());
		}

		repository.setAuthenticationManager(authManager);

		DefaultSVNOptions options = new DefaultSVNOptions();
		svnManager = SVNClientManager.newInstance(options, authManager);

		// svnManager.dispose();
		// repository.closeSession();
	} catch (SVNException e) {
		LOGGER.error(ValueUtil.toString(e));
		// throw new RuntimeException(e);
	}

}
 
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:34,代码来源:AbstractSVN.java

示例10: getRepository

import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的package包/类
private SVNRepository getRepository(String url) throws SVNException {
    DAVRepositoryFactory.setup();
    SVNURL svnUrl = SVNURL.parseURIEncoded(url);
    SVNRepository repository = SVNRepositoryFactory.create(svnUrl, null);
    ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager();
    repository.setAuthenticationManager(authManager);

    return repository;
}
 
开发者ID:Galiaf47,项目名称:forcepm,代码行数:10,代码来源:PackageBuilder.java

示例11: newSvnClientManager

import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的package包/类
static SVNClientManager newSvnClientManager(SvnConfiguration configuration) {
  ISVNOptions options = SVNWCUtil.createDefaultOptions(true);
  final char[] passwordValue = getCharsOrNull(configuration.password());
  final char[] passPhraseValue = getCharsOrNull(configuration.passPhrase());
  ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(
    null,
    configuration.username(),
    passwordValue,
    configuration.privateKey(),
    passPhraseValue,
    false);
  return SVNClientManager.newInstance(options, authManager);
}
 
开发者ID:SonarSource,项目名称:sonar-scm-svn,代码行数:14,代码来源:SvnPlugin.java

示例12: getSvnRepository

import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的package包/类
private SVNRepository getSvnRepository(String url) throws SVNException {
    SVNRepository repository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded(url));
    ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(
            settings.getUsername(), settings.getPassword());
    repository.setAuthenticationManager(authManager);
    return repository;
}
 
开发者ID:jimzucker,项目名称:hygieia-temp,代码行数:8,代码来源:DefaultSubversionClient.java

示例13: Subversion

import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的package包/类
public Subversion(final String url, final String user, final String pass) throws SVNException {
    try {
        setupType(url);
        authManager = SVNWCUtil.createDefaultAuthenticationManager(user, pass);

        ((DefaultSVNAuthenticationManager) authManager).setAuthenticationForced(true);
        repository.setAuthenticationManager(authManager);

        checkRoot();

    } catch (final SVNException e) {
        dispose();
        throw e;
    }
}
 
开发者ID:friedlwo,项目名称:AppWoksUtils,代码行数:16,代码来源:Subversion.java

示例14: main

import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
public static void main(String args[]) throws Exception {
	File importDir = new File(args[1] + "\\Repository\\");
	if (!importDir.exists())
		importDir.mkdirs();

	String username = "guest";
	String password = "";
	String srcRepositoryURL = args[0];

	ByteArrayOutputStream stream = new ByteArrayOutputStream();

	SVNDiffClient diff = new SVNDiffClient(
			SVNWCUtil
					.createDefaultAuthenticationManager(username, password),
			SVNWCUtil.createDefaultOptions(true));
	ISVNDiffGenerator defaultSVNDiffGenerator = diff.getDiffGenerator();

	defaultSVNDiffGenerator.setDiffAdded(true);
	defaultSVNDiffGenerator.setDiffDeleted(true);

	diff.setDiffGenerator(defaultSVNDiffGenerator);
	diff.doDiff(SVNURL.parseURIDecoded(srcRepositoryURL), SVNRevision.HEAD,
			SVNRevision.create(263024), SVNRevision.create(263817),
			SVNDepth.UNKNOWN, false, stream);

	Writer writer = new BufferedWriter(new FileWriter(new File(importDir
			+ "\\arquivo.txt")));
	writer.write(stream.toString());
	writer.close();
}
 
开发者ID:aserg-ufmg,项目名称:ModularityCheck,代码行数:32,代码来源:ChangedFile.java

示例15: setUp

import org.tmatesoft.svn.core.wc.SVNWCUtil; //导入方法依赖的package包/类
@Override
protected void setUp() throws Exception {
  super.setUp();
  DAVRepositoryFactory.setup();
  _repository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded(getSvnLocation()));
  ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(getUsername(), getPassword());
  _repository.setAuthenticationManager(authManager);
}
 
开发者ID:CoreFiling,项目名称:reviki,代码行数:9,代码来源:AddWikiWebTestSupport.java


注:本文中的org.tmatesoft.svn.core.wc.SVNWCUtil.createDefaultAuthenticationManager方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。