zoukankan      html  css  js  c++  java
  • svnkit添加节点

    package com.repositoryclient.svnoptions;
    
    import org.tmatesoft.svn.core.SVNException;
    import org.tmatesoft.svn.core.SVNURL;
    import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager;
    import org.tmatesoft.svn.core.internal.io.fs.FSRepositoryFactory;
    import org.tmatesoft.svn.core.io.ISVNEditor;
    import org.tmatesoft.svn.core.io.SVNRepository;
    import org.tmatesoft.svn.core.io.SVNRepositoryFactory;
    import org.tmatesoft.svn.core.wc.SVNWCUtil;
    
    public class StoreManagerFileNodeOption {
        private String repositoryUrl;
        private String userName;
        private String passwd;
        public StoreManagerFileNodeOption(String userName,String passwd,String repositoryUrl){
            this.repositoryUrl=repositoryUrl;
        }
        public void addNode(String nodeName){
            FSRepositoryFactory.setup();
            try {
                SVNRepository repository=SVNRepositoryFactory.create(SVNURL.parseURIDecoded(repositoryUrl));
                ISVNAuthenticationManager authenticationManager = SVNWCUtil
                        .createDefaultAuthenticationManager(userName, passwd);
                
                repository.setAuthenticationManager(authenticationManager);
                ISVNEditor editor=repository.getCommitEditor("logMessage", null,true,null);
                editor.openRoot(-1);
                editor.addDir(nodeName, null, -1);
                editor.closeDir();
                editor.closeEdit();
            } catch (SVNException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            
        }
        
        
        public void renameNode(){
            
    
        }
        
    //    public void deleteNode(){
    //        
    //    }
    }

    其实这里都有说明:http://wiki.svnkit.com/Committing_To_A_Repository

  • 相关阅读:
    ES6/ES2015核心内容 import export
    JavaScript 标准参考教程(alpha) 阮一峰
    NPM 学习笔记整理
    (尚026)Vue_案例_动态初始化显示(尚025)
    (尚025)Vue_案例_静态组件
    (尚024)Vue_案例_交互删除
    (尚023)Vue_案例_交互添加
    (尚022)Vue案例_初始化显示(十分详细!!!)
    (尚021)Vue_eslint编码规范检查
    (尚020)Vue打包发布项目
  • 原文地址:https://www.cnblogs.com/wangjiyuan/p/svnkit.html
Copyright © 2011-2022 走看看