java svnkit实现svn提交,更新等操作

官网: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;
}

 

转载于:https://www.cnblogs.com/songshu120/p/6171856.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值