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. 基于visual Studio2013解决面试题之0608找出两个只出现一次的数

     题目

  2. javascript 变量转义

    $(this).append('<a href="2-1partner.html"><div><img width="645" h ...

  3. MySQL 暂时文件夹

    MySQL数据文件夹/data/mysql所在的上层文件夹/data磁盘空间不足导致MySQL启动失败,所以清理了/data文件夹下除了mysql子文件夹外的其它无用文件夹.重新启动发现还是失败.检查 ...

  4. ice cave

    Description You play a computer game. Your character stands on some level of a multilevel ice cave. ...

  5. c# in depth之泛型的类型约束详细

    类型约束 1.引用类型约束 这种约束(表示成T:class,必须是为类型参数指定的第一个约束)用于确保使用的类型实参是引用类型,这可能是任何类,接口,数组,委托或者已知是引用类型的另一个类型参数. 例 ...

  6. JQuery+AJAX实现搜索文本框的输入提示功能

    平时使用谷歌搜索的时候发现只要在文本框里输入部分单词或字母,下面马上会弹出一个相关信息的内容框可供选择.感觉这个功能有较好的用户体验,所以也想在自己的网站上加上这种输入提示框. 实现的原理其实很简单, ...

  7. Android事件详解——拖放事件DragEvent

    1.Android拖放框架的作用? 利用Android的拖放框架,可以让用户用拖放手势把一个View中的数据移到当前layout内的另一个View中去. 2.拖放框架的内容? 1)拖放事件类 2)拖放 ...

  8. 百度地图new BMap.LocalCity() 问题

    <html> <head> <meta http-equiv="Content-Type" content="text/html; char ...

  9. 【ASP.NET Web API教程】5.5 ASP.NET Web API中的HTTP Cookie

    原文:[ASP.NET Web API教程]5.5 ASP.NET Web API中的HTTP Cookie 5.5 HTTP Cookies in ASP.NET Web API 5.5 ASP.N ...

  10. PPS2013校园招聘笔试题

    转载请标明出处,原文地址:http://blog.csdn.net/hackbuteer1/article/details/11473405 一.简答题 (1)一位老师有2个推理能力很强的学生,他告诉 ...