package com.repositoryclient.svnoptions;

import java.io.File;

import org.tmatesoft.svn.core.SVNCommitInfo;
import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl;
import org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions;
import org.tmatesoft.svn.core.wc.ISVNOptions;
import org.tmatesoft.svn.core.wc.SVNClientManager;
import org.tmatesoft.svn.core.wc.SVNCommitClient;
import org.tmatesoft.svn.core.wc.SVNWCUtil; public class ModelDeveloperUpLoadOption{
public boolean doUpLoad(String userName,String passwd,String SVNServerUrl,String dirPath,String folderName){
SVNClientManager ourClientManager;
// 初始化支持svn://协议的库
SVNRepositoryFactoryImpl.setup();
// 相关变量赋值
SVNURL repositoryUrl = null;
SVNURL uploadFolderUrl=null;
SVNURL[] folder=new SVNURL[];
try {
repositoryUrl = SVNURL.parseURIEncoded(SVNServerUrl);
uploadFolderUrl=SVNURL.parseURIEncoded(SVNServerUrl+folderName);
ISVNOptions options = SVNWCUtil.createDefaultOptions(true);
// 实例化客户端管理类
ourClientManager = SVNClientManager.newInstance(
(DefaultSVNOptions) options, userName, passwd);
// 要把此目录的内容导入到版本库
File impDir = new File(dirPath);
// 执行导入操作
SVNCommitClient svnCommitClient = ourClientManager.getCommitClient(); folder[]=uploadFolderUrl;
svnCommitClient.doMkDir(folder, folderName);
SVNCommitInfo commitInfo = svnCommitClient.doImport(impDir,
uploadFolderUrl, "import operation!", null, true, true,
SVNDepth.INFINITY);
//System.out.println(commitInfo.toString());
return true;
} catch (SVNException e) {
// TODO: handle exception
e.printStackTrace();
return false;
}
} }

注意,这个函数的第一个参数要包含新建的文件夹的名称,就是说给出的url一定是一个新的url。第二个参数可能是message之类的意思。

SVNKIT的SVNCommitClient的doMkDir的操作的更多相关文章

  1. SVNKit学习——使用低级别的API(ISVNEditor接口)直接操作Repository的目录和文件(五)

      本文是参考官方文档的实现,官方wiki:https://wiki.svnkit.com/Committing_To_A_Repository 本文核心使用的是ISVNEditor这个接口直接对Re ...

  2. SVNKit学习——基于Repository的操作之print repository tree、file content、repository history(四)

    此篇文章同样是参考SVNKit在wiki的官方文档做的demo,每个类都可以单独运行.具体的细节都写到注释里了~ 开发背景: SVNKit版本:1.7.14 附上官网下载链接:https://www. ...

  3. java操作svn【svnkit】实操

    SVNKit中怎样使用不同的仓库访问协议? 当你下载了最新版的SVNKit二进制文件并且准备使用它时,一个问题出现了,要创建一个库需要做哪些初始化的步骤?直接与Subversion仓库交互已经在低级层 ...

  4. SVNKIT操作SVN版本库的完整例子

    Model: package com.wjy.model; public class RepositoryInfo { public static String storeUrl="http ...

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

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

  6. svnkit 用java 操作 svn

    官网 https://svnkit.com/ https://blog.csdn.net/Hui_hai/article/details/80318518 https://blog.csdn.net/ ...

  7. 使用svnkit 的相关实例及相关问题汇总

    SVNKIT操作SVN版本库的完整例子 http://www.cnblogs.com/wangjiyuan/p/svnkitwanchenglizi.html#!comments 2.SVNClien ...

  8. SVNKIT的low api应用之修改库中文件内容(File modification)

    最近在做一个仓库管理系统,架构在svn之上.要求每一项操作要记录在log文件中,弄了很久起初感觉无法向库中的文本文件添加东西,就是修改库中的文本文件.于是采用了一个很笨的办法:    现将库中的log ...

  9. java操作svn工具类SvnUtil

    直接上代码,工作中使用的版本,记录下. public class SvnUtil { private static Logger logger = Logger.getLogger(SvnUtil.c ...

随机推荐

  1. Spring boot jar 后台运行

    start(){ now=`date "+%Y%m%d%H%M%S"` exec java -Xms256m -Xmx512m -jar /alidata/server/webap ...

  2. kernel hexdump分析

    驱动调试中,很多时候是二进制的,这个时候hexdump就是个非常有用的工具了. 不要再自己去实现类似的功能,kernel代码里面就有: 参考: kernel/lib/hexdump.c // 0Xxx ...

  3. HDU 4293 Groups

    模型挺好的dp题,其实这道题就是建一个模型然后就很容易想到递推过程了,我们可以把每个人的描述,存到数组a中,a[l][r]表示左边有l个,到第r个这个人所在一层停止...然后就可以写出转移状态方程了. ...

  4. mysql基础:列类型--整型

    mysql列类型--字符串  http://blog.csdn.net/jk110333/article/details/9342301 mysql列类型--时间和日期    http://blog. ...

  5. oracle 表连接 - hash join 哈希连接

    一. hash 连接(哈希连接)原理 指的是两个表连接时, 先利用两表中记录较少的表在内存中建立 hash 表, 然后扫描记录较多的表并探測 hash 表, 找出与 hash 表相匹配的行来得到结果集 ...

  6. 真正理解javascript的五道题目.

    题目一: if (!("a" in window)) { var a = 1; } alert(a); 题目二: var a = 1, b = function a(x) { x ...

  7. HDOJ 2442 -bricks 状态压缩DP 一直TLE.打表过的..

    有5个砖块..加上一个空着不放..那么有6种状态..所以很明显的可以用6进制的状态DP... 不过这么做..我觉得我已经能优化的都优化了...还是超时..一看数据范围是100*6..打表先AC了.. ...

  8. 使用wireshark常用的过滤命令

    使用wireshark常用的过滤命令 方法/步骤 过滤源ip.目的ip.在wireshark的过滤规则框Filter中输入过滤条件.如查找目的地址为192.168.101.8的包,ip.dst==19 ...

  9. HDU1849 Rabbit and Grass()

    用异或看取得的值是否为0推断 思想换没搞懂 #include<stdio.h> int main() { int ans,n,a; while(scanf("%d",& ...

  10. QSqlDatabase::addDatabase第一次运行的时候,生成SQLite文件的同时会产生一个默认连接

    QSqlDatabase::addDatabase第一次运行的时候,生成SQLite文件的同时会产生一个默认连接: QSqlDatabase database = QSqlDatabase::addD ...