官网:https://svnkit.com/

api:https://svnkit.com/javadoc/org/tmatesoft/svn/core/io/SVNRepository.html

wiki手册:https://wiki.svnkit.com/Getting_Started_With_SVNKit

几个例子

http://blog.csdn.net/hardwin/article/details/7963318

https://svnkit.com/javadoc/org/tmatesoft/svn/core/io/SVNRepository.html

http://www.cnblogs.com/wangjiyuan/p/svnkitwanchenglizi.html

http://xiangxji.iteye.com/blog/854773

http://blog.csdn.net/feiren127/article/details/7551782

#####################################################################

SVNKit的API主要分为两类:High Level API和Low Level API。 
通常情况下,我们使用High Level API即可完成工作任务。High Level API通过封装、使用Low Level API,使开发工作变得相对简单、容易。在此我们重点介绍High Level API。

一、建立仓库

public static SVNRepository getRepository(String url, String username, String password) {
    DAVRepositoryFactory.setup();
    SVNRepositoryFactoryImpl.setup();
    SVNRepository repository = null;
    SVNNodeKind nodeKind = null;
    try {
        repository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded(url));
        ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(username, password);
        repository.setAuthenticationManager(authManager);
        nodeKind = repository.checkPath("", -1);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
    if (nodeKind == SVNNodeKind.NONE) {
        throw new RuntimeException("There is no entry at '" + url + "'.");
    } else if (nodeKind == SVNNodeKind.FILE) {
        throw new RuntimeException("The entry at '" + url + "' is a file while a directory was expected.");
    }
    return repository;
}

 

相关文章:

  • 2021-11-01
  • 2021-12-03
  • 2022-01-01
  • 2021-11-24
  • 2021-09-18
  • 2021-04-23
  • 2021-04-29
  • 2022-01-01
猜你喜欢
  • 2022-12-23
  • 2022-02-08
  • 2021-07-17
  • 2021-07-03
  • 2021-12-09
  • 2021-08-15
相关资源
相似解决方案