java svnkit_java svnkit实现svn提交,更新等操作
官網(wǎng):https://svnkit.com/
api:https://svnkit.com/javadoc/org/tmatesoft/svn/core/io/SVNRepository.html
wiki手冊:https://wiki.svnkit.com/Getting_Started_With_SVNKit
幾個(gè)例子:
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即可完成工作任務(wù)。High?Level?API通過封裝、使用Low?Level?API,使開發(fā)工作變得相對簡單、容易。在此我們重點(diǎn)介紹High?Level?API。
一、建立倉庫
public staticSVNRepository 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 newRuntimeException(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.");
}returnrepository;
}
總結(jié)
以上是生活随笔為你收集整理的java svnkit_java svnkit实现svn提交,更新等操作的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 微信重磅更新:PC版终于可以独立登陆了
- 下一篇: 使用电脑时发现c盘红了电脑c盘红了会怎么