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


Java ISVNAuthenticationManager类代码示例

本文整理汇总了Java中org.tmatesoft.svn.core.auth.ISVNAuthenticationManager的典型用法代码示例。如果您正苦于以下问题:Java ISVNAuthenticationManager类的具体用法?Java ISVNAuthenticationManager怎么用?Java ISVNAuthenticationManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: connectToSVNInstance

import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; //导入依赖的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.auth.ISVNAuthenticationManager; //导入依赖的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: requestClientAuthentication

import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; //导入依赖的package包/类
public SVNAuthentication requestClientAuthentication(final String kind,
                                                     final SVNURL url,
                                                     final String realm,
                                                     SVNErrorMessage errorMessage,
                                                     final SVNAuthentication previousAuth,
                                                     final boolean authMayBeStored) {
  if (ApplicationManager.getApplication().isUnitTestMode() && ISVNAuthenticationManager.USERNAME.equals(kind)) {
    final String userName = previousAuth != null && previousAuth.getUserName() != null ? previousAuth.getUserName() : SystemProperties.getUserName();
    return new SVNUserNameAuthentication(userName, false);
  }
  final SvnAuthenticationNotifier.AuthenticationRequest obj =
    new SvnAuthenticationNotifier.AuthenticationRequest(myProject, kind, url, realm);
  final SVNURL wcUrl = myAuthenticationNotifier.getWcUrl(obj);
  if (wcUrl == null || ourForceInteractive.contains(Thread.currentThread())) {
    // outside-project url
    return mySvnInteractiveAuthenticationProvider.requestClientAuthentication(kind, url, realm, errorMessage, previousAuth, authMayBeStored);
  } else {
    if (myAuthenticationNotifier.ensureNotify(obj)) {
      return myAuthenticationManager.requestFromCache(kind, url, realm, errorMessage, previousAuth, authMayBeStored);
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:SvnAuthenticationProvider.java

示例4: getKinds

import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; //导入依赖的package包/类
@NotNull
public static List<String> getKinds(final SVNURL url, boolean passwordRequest) {
  if (passwordRequest || "http".equals(url.getProtocol())) {
    return Collections.singletonList(ISVNAuthenticationManager.PASSWORD);
  }
  else if ("https".equals(url.getProtocol())) {
    return Collections.singletonList(ISVNAuthenticationManager.SSL);
  }
  else if ("svn".equals(url.getProtocol())) {
    return Collections.singletonList(ISVNAuthenticationManager.PASSWORD);
  }
  else if (url.getProtocol().contains("svn+")) {  // todo +-
    return Arrays.asList(ISVNAuthenticationManager.SSH, ISVNAuthenticationManager.USERNAME);
  }
  return Collections.singletonList(ISVNAuthenticationManager.USERNAME);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:AuthenticationService.java

示例5: performSVNupdate

import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; //导入依赖的package包/类
/**
 * @param svnPathString
 *            String which contains the local SVN folder path.
 * @return Error code. If true --> SVN Operation failed.
 */
public final boolean performSVNupdate(final String svnPathString) {
    SfdcCommander commander = SfdcCommander.getInstance();
    boolean error = false;
    File svnPath = new File(svnPathString);

    // checkout
    try {
        ISVNAuthenticationManager authManager = getAuthManager(config);
        SVNUpdateClient updateClient = new SVNUpdateClient(authManager,
                SVNWCUtil.createDefaultOptions(true));

        updateClient.doUpdate(svnPath, SVNRevision.HEAD, SVNDepth.INFINITY,
                true, true);
        commander.info("SVN Update successfully processed.");
    } catch (SVNException e) {
        commander.info(e.getMessage());
        error = true;
    }
    return error;
}
 
开发者ID:jwiesel,项目名称:sfdcCommander,代码行数:26,代码来源:SvnHandler.java

示例6: performSVNcommit

import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; //导入依赖的package包/类
/**
 * @param svnPathString
 *            String which contains the local SVN folder path.
 * @param aComment
 *            The SVN Comment which has been entered.
 * @param aConfig
 *            CommanderConfig for SVN Connect.
 * @return Error code. If true --> SVN Operation failed.
 */
public final boolean performSVNcommit(final String svnPathString,
        final String aComment, final CommanderConfig aConfig) {
    SfdcCommander commander = SfdcCommander.getInstance();
    boolean error = false;
    File[] paths = new File[1];
    // paths[0] = projectFile;
    // boolean svnNew = false;

    // svn add
    SVNProperties props = new SVNProperties();
    try {
        ISVNAuthenticationManager authManager = getAuthManager(config);
        // if (svnNew) {
        // SVNWCClient addClient = new SVNWCClient(authManager,
        // SVNWCUtil.createDefaultOptions(true));
        // addClient.doAdd(projectFile, true, false, true,
        // SVNDepth.INFINITY, true, true);
        // commander.notify("Projectfile successfully added.");
        // }
        // commit
        SVNCommitClient commitClient = new SVNCommitClient(authManager,
                SVNWCUtil.createDefaultOptions(true));
        commitClient.doCommit(paths, false, aComment, props, null, false,
                true, SVNDepth.INFINITY);
        commander.info("Projectfile successfully commited.");

    } catch (SVNException e) {
        commander.info(e.getMessage());
        error = true;
    }

    return error;

}
 
开发者ID:jwiesel,项目名称:sfdcCommander,代码行数:44,代码来源:SvnHandler.java

示例7: checkout

import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; //导入依赖的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

示例8: getCommits

import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; //导入依赖的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

示例9: getAuthManager

import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; //导入依赖的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

示例10: openRepository

import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; //导入依赖的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

示例11: createRepository

import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; //导入依赖的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

示例12: requestClientAuthentication

import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; //导入依赖的package包/类
public SVNAuthentication requestClientAuthentication(final String kind,
                                                     final SVNURL url,
                                                     final String realm,
                                                     SVNErrorMessage errorMessage,
                                                     final SVNAuthentication previousAuth,
                                                     final boolean authMayBeStored) {
  if (ApplicationManager.getApplication().isUnitTestMode() && ISVNAuthenticationManager.USERNAME.equals(kind)) {
    final String userName = previousAuth != null && previousAuth.getUserName() != null ? previousAuth.getUserName() : SystemProperties.getUserName();
    return new SVNUserNameAuthentication(userName, false);
  }
  final SvnAuthenticationNotifier.AuthenticationRequest obj =
    new SvnAuthenticationNotifier.AuthenticationRequest(myProject, kind, url, realm);
  final SVNURL wcUrl = myAuthenticationNotifier.getWcUrl(obj);
  if (wcUrl == null || ourForceInteractive.contains(Thread.currentThread())) {
    // outside-project url
    return mySvnInteractiveAuthenticationProvider.requestClientAuthentication(kind, url, realm, errorMessage, previousAuth, authMayBeStored);
  } else {
    if (myAuthenticationNotifier.ensureNotify(obj)) {
      return (SVNAuthentication) myAuthenticationStorage.getData(kind, realm);
    }
  }
  return null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:SvnAuthenticationProvider.java

示例13: logModificacoesSVN

import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; //导入依赖的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

示例14: getRepository

import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; //导入依赖的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

示例15: getWithActive

import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; //导入依赖的package包/类
@Override
protected boolean getWithActive(final SvnAuthenticationManager active) throws SVNException {
  if (ISVNAuthenticationManager.SSL.equals(myKind)) {
    if (super.getWithActive(active)) return true;
  }
  myAuthentication = active.getProvider().requestClientAuthentication(myKind, myUrl, myRealm, null, null, true);
  myStoreInUsual = myAuthenticationService.getTempDirectory() == null && myAuthentication != null && myAuthentication.isStorageAllowed();

  return myAuthentication != null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:CredentialsAuthenticator.java


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