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


Java SVNRepositoryFactory类代码示例

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


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

示例1: init

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

示例2: openRepository

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

示例3: createRepository

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

示例4: testReplayFileModification

import org.tmatesoft.svn.core.io.SVNRepositoryFactory; //导入依赖的package包/类
@Test
public void testReplayFileModification() throws Exception {
  try (SvnTestServer server = SvnTestServer.createEmpty()) {
    final URL repoMark = ReplayTest.class.getResource("repo/format");
    final SVNURL url = SVNURL.fromFile(new File(repoMark.getPath()).getParentFile());
    final SVNRepository srcRepo = SVNRepositoryFactory.create(url);
    final SVNRepository dstRepo = server.openSvnRepository();

    long lastRevision = srcRepo.getLatestRevision();
    log.info("Start replay");
    for (long revision = 1; revision <= lastRevision; revision++) {
      final SVNPropertyValue message = srcRepo.getRevisionPropertyValue(revision, "svn:log");
      log.info("  replay commit #{}: {}", revision, StringHelper.getFirstLine(message.getString()));
      replayRangeRevision(srcRepo, dstRepo, revision, false);
      log.info("  compare revisions #{}: {}", revision, StringHelper.getFirstLine(message.getString()));
      compareRevision(srcRepo, revision, dstRepo, dstRepo.getLatestRevision());
    }
    log.info("End replay");
  }
}
 
开发者ID:bozaro,项目名称:git-as-svn,代码行数:21,代码来源:ReplayTest.java

示例5: logModificacoesSVN

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

示例6: checkoutTest

import org.tmatesoft.svn.core.io.SVNRepositoryFactory; //导入依赖的package包/类
public void checkoutTest() throws SVNException {
    String checkoutPath = "svn://localhost";
    String username = "integration";
    String password = "integration";
    String checkoutRootPath = new File("/home/jeremie/Developpement/checkoutsvn").getAbsolutePath();

    DAVRepositoryFactory.setup();

    final SVNRepository repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(checkoutPath));
    repository.setAuthenticationManager(SVNWCUtil.createDefaultAuthenticationManager(username, password));

    final SVNClientManager clientManager = SVNClientManager.newInstance(null, repository.getAuthenticationManager());
    final SVNUpdateClient updateClient = clientManager.getUpdateClient();

    updateClient.setIgnoreExternals(false);

    final SVNNodeKind nodeKind = repository.checkPath("", -1);

    if (nodeKind == SVNNodeKind.NONE) {
        System.err.println("There is no entry at '" + checkoutPath + "'.");
        System.exit(1);
    } else if (nodeKind == SVNNodeKind.FILE) {
        System.err.println("The entry at '" + checkoutPath + "' is a file while a directory was expected.");
        System.exit(1);
    }
    System.out.println("*** CHECKOUT SVN Trunk/Branches ***");
    System.out.println("Checkout source: " + checkoutPath);
    System.out.println("Checkout destination: " + checkoutRootPath);
    System.out.println("...");
    try {
        traverse(updateClient, repository, checkoutPath, checkoutRootPath, "", true);
    } catch (final Exception e) {
        System.err.println("ERROR : " + e.getMessage());
        e.printStackTrace(System.err);
        System.exit(-1);
    }
    System.out.println("");
    System.out.println("Repository latest revision: " + repository.getLatestRevision());
}
 
开发者ID:klask-io,项目名称:klask-io,代码行数:40,代码来源:TestCheckOut.java

示例7: getRepository

import org.tmatesoft.svn.core.io.SVNRepositoryFactory; //导入依赖的package包/类
/**
 * Returns the SVN repository used to manage metadata versions in this
 * store.
 *
 * @return the SVN repository used to manage metadata versions in this
 *         store.
 */
SVNRepository getRepository() throws SVNException {
    SVNRepository repository = SVNRepositoryFactory.create(repURL);
    String user = MCRSessionMgr.getCurrentSession().getUserInformation().getUserID();
    SVNAuthentication[] auth = {
        SVNUserNameAuthentication.newInstance(user, false, repURL, false) };
    BasicAuthenticationManager authManager = new BasicAuthenticationManager(auth);
    repository.setAuthenticationManager(authManager);
    return repository;
}
 
开发者ID:MyCoRe-Org,项目名称:mycore,代码行数:17,代码来源:MCRVersioningMetadataStore.java

示例8: init

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

示例9: getRepository

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

示例10: createRepository

import org.tmatesoft.svn.core.io.SVNRepositoryFactory; //导入依赖的package包/类
public void createRepository(File path, String repositoryType)
          throws SVNClientException {
  	if (REPOSITORY_FSTYPE_BDB.equalsIgnoreCase(repositoryType))
  		throw new SVNClientException("SVNKit only supports fsfs repository type.");
  	try {
  		boolean force = false;
  		boolean enableRevisionProperties = false;
	SVNRepositoryFactory.createLocalRepository(path, enableRevisionProperties, force);
} catch (SVNException e) {
          notificationHandler.logException(e);
          throw new SVNClientException(e);
}
   }
 
开发者ID:subclipse,项目名称:svnclientadapter,代码行数:14,代码来源:SvnKitClientAdapter.java

示例11: createRepository

import org.tmatesoft.svn.core.io.SVNRepositoryFactory; //导入依赖的package包/类
@Override
public SVNRepository createRepository(SVNURL url, boolean mayReuse) throws SVNException {
  final SVNRepository repos = SVNRepositoryFactory.create(url, this);
  repos.setAuthenticationManager(myManager);
  repos.setTunnelProvider(myTunnelProvider);
  repos.setDebugLog(new ProxySvnLog(SVNDebugLog.getDefaultLog()));
  repos.setCanceller(new MyCanceller());
  return repos;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:PrimitivePool.java

示例12: createRepository

import org.tmatesoft.svn.core.io.SVNRepositoryFactory; //导入依赖的package包/类
@NotNull
public SVNRepository createRepository(@NotNull SVNURL url) throws SVNException {
  SVNRepository repository = SVNRepositoryFactory.create(url);
  repository.setAuthenticationManager(getAuthenticationManager());
  repository.setTunnelProvider(getSvnOptions());

  return repository;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:SvnKitManager.java

示例13: getSvnRepository

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

示例14: setupType

import org.tmatesoft.svn.core.io.SVNRepositoryFactory; //导入依赖的package包/类
private void setupType(final String url) throws SVNException {
    svnurl = SVNURL.parseURIDecoded(url);

    if (url.startsWith("http")) {
        DAVRepositoryFactory.setup();
        repository = SVNRepositoryFactory.create(svnurl);
    } else if (url.startsWith("svn")) {
        SVNRepositoryFactoryImpl.setup();
        repository = SVNRepositoryFactory.create(svnurl);
    } else {
        FSRepositoryFactory.setup();
        repository = SVNRepositoryFactory.create(svnurl);
    }
}
 
开发者ID:friedlwo,项目名称:AppWoksUtils,代码行数:15,代码来源:Subversion.java

示例15: createRepository

import org.tmatesoft.svn.core.io.SVNRepositoryFactory; //导入依赖的package包/类
private SVNRepository createRepository() {
  try {
    return SVNRepositoryFactory.create(_url);
  }
  catch (SVNException ex) {
    throw new RuntimeException("Invalid repository.", ex);
  }
}
 
开发者ID:CoreFiling,项目名称:reviki,代码行数:9,代码来源:BasicAuthPassThroughBasicSVNOperationsFactory.java


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