`
yaerfeng1989
  • 浏览: 226523 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

java有没有开源框架可以获取svn信息的

阅读更多

代码下载地址:http://www.zuidaima.com/share/1550463238638592.htm

想通过java程序来自动监控svn的版本更新情况,不知道能否实现,有的话给提供个代码,多谢了。

原文:java有没有开源框架可以获取svn信息的

1
0
分享到:
评论
1 楼 ahack 2014-06-29  
发个登陆的,其他的自己看api。
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager;
import org.tmatesoft.svn.core.io.SVNRepository;
import org.tmatesoft.svn.core.io.SVNRepositoryFactory;
import org.tmatesoft.svn.core.wc.SVNWCUtil;
 
public class Svn {
 
    @SuppressWarnings("deprecation")
    public static boolean login(String url,String user,String pass){
        SVNRepository repository = null;
        try {
            repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(url));
            ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(user,pass);
            repository.setAuthenticationManager(authManager);
            repository.testConnection();
            return true;
        } catch (SVNException e) {
            System.out.println(e.toString());
        }
        return false;
    }
 
}

相关推荐

Global site tag (gtag.js) - Google Analytics