- 浏览: 738461 次
- 性别:
- 来自: 杭州
文章分类
最新评论
-
lgh1992314:
a offset: 26b offset: 24c offse ...
java jvm字节占用空间分析 -
ls0609:
语音实现在线听书http://blog.csdn.net/ls ...
Android 语音输入API使用 -
wangli61289:
http://viralpatel-net-tutorials ...
Android 语音输入API使用 -
zxjlwt:
学习了素人派http://surenpi.com
velocity宏加载顺序 -
tt5753:
谢啦........
Lucene的IndexWriter初始化时的LockObtainFailedException的解决方法
1.pom依赖
<dependency> <groupId>org.tmatesoft.svnkit</groupId> <artifactId>svnkit</artifactId> <version>1.3.5</version> </dependency>
2.java调用代码
import java.io.File;
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.dav.DAVRepositoryFactory; import org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions; import org.tmatesoft.svn.core.wc.SVNClientManager; import org.tmatesoft.svn.core.wc.SVNLogClient; import org.tmatesoft.svn.core.wc.SVNRevision; import org.tmatesoft.svn.core.wc.SVNUpdateClient; public class SvnTest { static { DAVRepositoryFactory.setup(); } private SVNClientManager manager; private SVNURL repositoryBaseUrl; public SvnTest() { DefaultSVNOptions options = new DefaultSVNOptions(); manager = SVNClientManager.newInstance(options); // manager = SVNClientManager.newInstance(options, // "username","passwrod"); //如果需要用户名密码 try { repositoryBaseUrl = SVNURL .parseURIDecoded("http://svn.apache.org/repos/asf/logging/log4j/trunk/src/main/java/org/apache/log4j/or"); // 传入svn地址 } catch (SVNException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public void test() throws SVNException { SVNLogClient logClient = manager.getLogClient(); // svn list DirEntryHandler handler = new DirEntryHandler(); // 在svn // co时对每个文件目录的处理,实现ISVNDirEntryHandler接口 logClient.doList(repositoryBaseUrl, SVNRevision.HEAD, SVNRevision.HEAD, false, true, handler); // 列出当前svn地址的目录,对每个文件进行处理 // svn co UpdateEventHandler svnEventHandler = new UpdateEventHandler(); // svn co时对每个文件的处理 SVNUpdateClient client = manager.getUpdateClient(); client.setIgnoreExternals(true); client.setEventHandler(svnEventHandler); File to = new File("e:\\log\\testsvn"); // co出來的文件存放目錄 client.doCheckout(repositoryBaseUrl, to, SVNRevision.HEAD, SVNRevision.HEAD, SVNDepth.INFINITY, false); // svn update client.setIgnoreExternals(true); client.setEventHandler(svnEventHandler); client.doUpdate(to, SVNRevision.HEAD, SVNDepth.INFINITY,true, false); } public static void main(String[] args) throws SVNException { SvnTest svntest = new SvnTest(); svntest.test(); } }
import java.util.ArrayList; import java.util.List; import org.tmatesoft.svn.core.ISVNDirEntryHandler; import org.tmatesoft.svn.core.SVNDirEntry; import org.tmatesoft.svn.core.SVNException; import org.tmatesoft.svn.core.SVNNodeKind; import com.alibaba.tools.code.SearchConfig; public class DirEntryHandler implements ISVNDirEntryHandler { @Override public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException { System.out.println(dirEntry.getRelativePath() + "/" + dirEntry.getName()); } }
import java.io.IOException; import org.apache.commons.io.FileUtils; import org.tmatesoft.svn.core.SVNCancelException; import org.tmatesoft.svn.core.SVNNodeKind; import org.tmatesoft.svn.core.wc.ISVNEventHandler; import org.tmatesoft.svn.core.wc.SVNEvent; import org.tmatesoft.svn.core.wc.SVNEventAction; public class UpdateEventHandler implements ISVNEventHandler { public void handleEvent(SVNEvent event, double progress) { SVNEventAction action = event.getAction(); SVNNodeKind nodeKind = event.getNodeKind(); if (SVNNodeKind.DIR.equals(nodeKind)) { // folder System.out.println(event.getFile().getName()); } else { // treat as file for all other type if (action == SVNEventAction.UPDATE_DELETE) { try { System.out.println(event.getFile().getName() + "\t" + FileUtils.readFileToString(event.getFile())); } catch (IOException e) { } } else if (action == SVNEventAction.UPDATE_ADD || action == SVNEventAction.UPDATE_UPDATE) { try { System.out.println(event.getFile().getName() + "\t" + FileUtils.readFileToString(event.getFile())); } catch (IOException e) { } } } } public void checkCancelled() throws SVNCancelException { } }
输出:
/or jms/jms jms/MessageRenderer.java/MessageRenderer.java jms/package.html/package.html sax/sax sax/AttributesRenderer.java/AttributesRenderer.java sax/package.html/package.html DefaultRenderer.java/DefaultRenderer.java ObjectRenderer.java/ObjectRenderer.java RendererMap.java/RendererMap.java ThreadGroupRenderer.java/ThreadGroupRenderer.java package.html/package.html testsvn testsvn
API参考:
发表评论
-
对字符串进行验证之前先进行规范化
2013-09-17 23:18 13876对字符串进行验证之前先进行规范化 应用系统中经常对字 ... -
使用telnet连接到基于spring的应用上执行容器中的bean的任意方法
2013-08-08 09:17 1423使用telnet连接到基于spring的应用上执行容器中 ... -
jdk7和8的一些新特性介绍
2013-07-06 16:07 10063更多ppt内容请查看:htt ... -
Lucene的IndexWriter初始化时的LockObtainFailedException的解决方法
2013-06-28 21:35 11727原文链接: http://www.javaarch.net ... -
java对于接口和抽象类的代理实现,不需要有具体实现类
2013-06-12 09:50 2902原文链接:http://www.javaarch.net/j ... -
Excel2007格式分析和XML解析
2013-06-07 09:56 10605在物料清单采购中,用到excel上传文件解析功能,不 ... -
Java EE 7中对WebSocket 1.0的支持
2013-06-05 09:27 3794原文链接:http://www.javaarch.n ... -
java QRCode生成示例
2013-06-05 09:26 1459原文链接:http://www.javaarch.n ... -
Spring Security Logout
2013-06-03 00:05 2317原文地址:http://www.javaarch.net/ ... -
Spring Security Basic Authentication
2013-06-03 00:04 1690原文地址:http://www.javaarch.net/ ... -
Spring Security Form Login
2013-06-02 16:16 2107原文地址:http://www.javaarch.net/j ... -
spring3 的restful API RequestMapping介绍
2013-06-02 14:53 1112原文链接:http://www.javaarch.net/j ... -
Java Web使用swfobject调用flex图表
2013-05-28 19:05 1074Java Web使用swfobject调用 ... -
spring使用PropertyPlaceholderConfigurer扩展来满足不同环境的参数配置
2013-05-21 15:57 3283spring使用PropertyPlaceholderCon ... -
java国际化
2013-05-20 20:57 4432java国际化 本文来自:http://www.j ... -
RSS feeds with Java
2013-05-20 20:52 1181RSS feeds with Java 原文来自:htt ... -
使用ibatis将数据库从oracle迁移到mysql的几个修改点
2013-04-29 10:40 1627我们项目在公司的大战略下需要从oracle ... -
线上机器jvm dump分析脚本
2013-04-19 10:48 2854#!/bin/sh DUMP_PIDS=`p ... -
spring3学习入门示例工程
2013-04-18 09:28 10831. github地址 https://github ... -
spring map使用annotation泛型注入问题分析
2013-04-15 13:30 8498今天在整一个spring的ioc学习demo,碰到 ...
相关推荐
eureka-producer-consumer:利用eureka实现服务提供与调用示例 spring-cloud-hystrix:Hystrix熔断的使用示例 hystrix-dashboard-turbine:熔断监控Hystrix Dashboard和Turbine的示例 spring-cloud-config-git:配置...
eureka-producer-consumer:利用eureka实现服务提供与调用示例 spring-cloud-hystrix:Hystrix熔断的使用示例 hystrix-dashboard-turbine:熔断监控Hystrix Dashboard和Turbine的示例 spring-cloud-config-git:配置...
- [eureka-producer-consumer](https://github.com/ityouknow/spring-cloud-examples/tree/master/eureka-producer-consumer):利用eureka实现服务提供与调用示例 - [spring-cloud-hystrix]...
1.6.15 使用NetBeans作为SVN客户端 48 1.7 本章小结 50 第2章 JSF的基本用法 51 2.1 MVC和JSF 52 2.1.1 MVC和常见MVC框架 52 2.1.2 JSF的优势 56 2.2 下载和安装JSF 57 2.3 JSF使用入门 60 2.3.1 从输入页面开始 60 ...
Spring Cloud使用的各种示例,以最简单,最实用为标准 eureka:eureka服务器单机,双机,替换示例:利用eureka实现服务提供与调用示例 :Hystrix熔断的使用示例 :熔断监控Hystrix仪表板和Turbine的示例 :配置中心...
Spring Cloud ExamplesDemo website: | Spring Cloud使用的各种示例,以最简单、最实用为标准:eureka server单机、双机、集群示例:利用eureka实现服务提供与调用示例:Hystrix熔断的使用示例:熔断监控Hystrix ...
21. Java 认证和授权服务(JAAS)供应器 21.1. 概述 21.2. 配置 21.2.1. JAAS CallbackHandler 21.2.2. JAAS AuthorityGranter 22. CAS 认证 22.1. 概述 22.2. CAS 是如何工作的 22.3. 配置CAS ...
6、Portal中调用PUMA SPI管理用户和组信息 51 7、WCM内存溢出的解决方法 53 七、组件及其标签 53 (一)、标签 53 1、jsp组件 53 2、组件关联格式 54 3、IDCmpnt标签 55 4、workflowcmpnt标签 55 5、securitycmpnt...