亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? svnmanager.java

?? java讀取svn配置庫.需要安裝Subversion服務(wù)端
?? JAVA
字號:
package svnexample;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;

import org.tmatesoft.svn.core.SVNCommitInfo;
import org.tmatesoft.svn.core.SVNErrorCode;
import org.tmatesoft.svn.core.SVNErrorMessage;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNLogEntry;
import org.tmatesoft.svn.core.SVNNodeKind;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.auth.BasicAuthenticationManager;
import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager;
import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory;
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.io.diff.SVNDeltaGenerator;
import org.tmatesoft.svn.core.wc.ISVNOptions;
import org.tmatesoft.svn.core.wc.SVNClientManager;
import org.tmatesoft.svn.core.wc.SVNDiffClient;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc.SVNWCUtil;

/**
 * This class is our gateway into Subversion. It encapsulates all the calls into
 * the JavaSVN.
 */
public class SVNManager {
	
	//Since the repository does not handle multiple threads simultaneously
	//there is no requirement to make the SVNManager thread safe.
	
	//Currently all configurable items are hard coded

	private SVNRepository theRepository;
	
	public SVNManager() {
		initRepository();
	}
	
	public SVNResult checkInObject(BaseTrackingObject obj){
		SVNResult returnVal = new SVNResult();
		try {					
			ISVNEditor editor = null;	
			//Check if the DomainObjects, Object directory are present
			//and also the object file
			boolean domainDirectoryPresent = false,
					objectDirectoryPresent = false,
					filePresent = false;
			String path = "/DomainObjects/";
			SVNNodeKind nodeKind = theRepository.checkPath(path, -1);	
			if (nodeKind != SVNNodeKind.NONE) {
				domainDirectoryPresent = true;
			}
			path += obj.getClass() + "/";
			nodeKind = theRepository.checkPath(path, -1);
			if (nodeKind != SVNNodeKind.NONE) {
				objectDirectoryPresent = true;
			}
			path += obj.getObjectId() ;
			nodeKind = theRepository.checkPath(path, -1);
			if (nodeKind != SVNNodeKind.NONE) {
				filePresent = true;
			}
			//Obtain the editor handle from the repository
			editor = theRepository.getCommitEditor(
					obj.getModificationReason(), null);
			//reset the path and start off
			path = "/DomainObjects/";
			editor.openRoot(-1);
			//This two step process of check and then open/add is required
			//as the SVNRepository locks itself once the editor is obtained 
			//until the time the editor has been closed.
			//Check if the directories and files are present, 
			//if not, add them.
			if(!domainDirectoryPresent) {
				editor.addDir(path, null, -1);						
			}
			else {
				editor.openDir(path, -1);			
			}
			path += obj.getClass() + "/";
			if(!objectDirectoryPresent) {
				editor.addDir(path, null, -1);
			}
			else {
				editor.openDir(path, -1);			
			}
			path += obj.getObjectId();
			if(!filePresent) {
				//create the file at the specified path
				editor.addFile(path, null, -1);
			}
			else {
				//file is already present, so open the file
				//in the repository
				editor.openFile(path, -1);
			}
			editor.applyTextDelta(path, null);
			
			//Create a new instance of SVNDeltaGenerator to generate the difference
			//windows and supply them to the editor
			SVNDeltaGenerator deltaGenerator = new SVNDeltaGenerator();
			
			String checksum = deltaGenerator.sendDelta(path, 
					new ByteArrayInputStream(obj.
					getXmlRepresentation().getBytes()), 
					editor, true);
			editor.closeFile(path, checksum);
			//close the object directory		
			editor.closeDir();
			//close the DomainObject directory
			editor.closeDir();
			//close the head
			editor.closeDir();
			returnVal.setSuccessful(true);
			//closing the editor is equivalent of the commit
			SVNCommitInfo svnMessage = editor.closeEdit();
			returnVal.setSvnMessage(svnMessage.toString());
			
		}
		catch(Exception exp) {
			//generic placeholder!
			System.out.println(exp);
			exp.printStackTrace();
			returnVal.setSuccessful(false);
			returnVal.setSvnMessage(exp.toString());
		}
		return returnVal;
	}
	
	public List getRevisionLog(BaseTrackingObject obj, 
		long startRevision, long endRevision) {						
		List returnVal = new ArrayList();
		try {
			String path = "/DomainObjects/"+ obj.getClass() + "/" +
							obj.getObjectId();
			if(endRevision==-1) {
				//obtain the latest revision from the repository
				endRevision = theRepository.getLatestRevision();				
			}
			//retrieve the various log entries for the particular 
			//object path
			Collection revisionLogs = theRepository.log(new String[] {path}, null,
					startRevision, endRevision, false, true);
			for (Iterator log = revisionLogs.iterator(); log.hasNext();) {
				SVNLogEntry logEntry = (SVNLogEntry) log.next();
				SVNRevisionInfo revisionInfo = new SVNRevisionInfo();
				revisionInfo.setRevisionNumber(logEntry.getRevision());
				revisionInfo.setModifiedUser(logEntry.getAuthor());
				revisionInfo.setRevisionDate(logEntry.getDate());
				revisionInfo.setModificationReason(logEntry.getMessage());
				ByteArrayOutputStream xmlFileContentsStream =
					new ByteArrayOutputStream();	
				//Obtain the contents of the object at the specified
				//revision				
				theRepository.getFile(path, revisionInfo.getRevisionNumber(),
					new Properties(),xmlFileContentsStream);
				revisionInfo.setRevisionContents(
						new String(xmlFileContentsStream.toByteArray()));	
				returnVal.add(revisionInfo);
			}
		}
		catch(Exception exp) {
			//generic placeholder!
			System.out.println(exp);
			exp.printStackTrace();
		}
		return returnVal;
	}
	
	public String showDifferences(BaseTrackingObject obj, long revision1, 
			long revision2) {
		String returnVal = "";
		try {
			SVNURL svnUrl = theRepository.getLocation().
				appendPath("/DomainObjects/"+ obj.getClass() + "/" +
				obj.getObjectId(), false);
			 //Create an instance of SVNClientManager providing authentication
			 //information (name, password) and an options driver
			ISVNOptions options = SVNWCUtil.createDefaultOptions(true);
			SVNClientManager ourClientManager = 
					SVNClientManager.newInstance(options, "name", "password");
	        //Obtain the handle to DiffClient from the client
	        //manager
			SVNDiffClient theDiff = ourClientManager.getDiffClient();
			ByteArrayOutputStream diffStream =
				new ByteArrayOutputStream();	
			theDiff.doDiff(svnUrl, SVNRevision.create(revision1), svnUrl, 
				SVNRevision.create(revision2), false, false, diffStream);
			returnVal = new String(diffStream.toByteArray());	
		}
		catch(Exception e) {
			e.printStackTrace();
		}
		return returnVal;
	}
	
	public void initRepository() {
		//initialize the system to work over http
		DAVRepositoryFactory.setup();
		//credentials to authenticate into SVN
		String name = "user";
		String password = "pwd";
		try {
			//point to the root folder in the repository
			SVNURL svnUrl = SVNURL.parseURIEncoded("http://localhost/repos/");
			//initialize the SVNRepository
			theRepository = SVNRepositoryFactory.create(svnUrl);						
			//Creates the Auth manager with our user
			//and password credentials
			ISVNAuthenticationManager authManager = 
				new BasicAuthenticationManager
				(name, password);
			//pass on the credentials to the repository handle	
			theRepository.setAuthenticationManager(authManager);
			
			//obtain the type of node pointed to by the location
			SVNNodeKind nodeKind = theRepository.checkPath("", -1);	
			
			//ensure that we are at a top directory.
			if (nodeKind == SVNNodeKind.NONE) {
				SVNErrorMessage err = 
					SVNErrorMessage.create(SVNErrorCode.UNKNOWN, 
					"No entry at URL ''{0}''", svnUrl);
				throw new SVNException(err);
			} else if (nodeKind == SVNNodeKind.FILE) {
				SVNErrorMessage err = 
						SVNErrorMessage.create(SVNErrorCode.UNKNOWN, 
						"Entry at URL ''{0}'' is a file while " +
						"directory was expected", svnUrl);
				throw new SVNException(err);
			}
 

		} catch (SVNException e) {
			System.err.println("Error in initializing the system !");
			System.exit(1);
		}
		
	}
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99久久99久久久精品齐齐| 国产iv一区二区三区| 亚洲欧美偷拍另类a∨色屁股| 亚洲一区二区综合| 久久精品999| 欧美三级蜜桃2在线观看| 精品美女一区二区| 亚洲最大成人综合| 天堂av在线一区| 色婷婷久久综合| 欧美激情综合五月色丁香小说| 免费欧美在线视频| 7777精品伊人久久久大香线蕉的 | 青青草国产精品97视觉盛宴| 日韩三区在线观看| 日韩精品色哟哟| 久久精品亚洲乱码伦伦中文| 青青草国产精品97视觉盛宴| 久久久久久久久岛国免费| 毛片一区二区三区| 日韩欧美成人一区二区| 日韩国产精品91| 91精品婷婷国产综合久久性色 | 中文文精品字幕一区二区| 亚洲宅男天堂在线观看无病毒 | 久久亚洲精品国产精品紫薇| 免费av成人在线| 欧美国产综合一区二区| 欧美视频一区二区| 日本午夜一区二区| 国产精品第四页| 色婷婷国产精品| 激情深爱一区二区| 国产午夜精品一区二区三区视频| 在线亚洲精品福利网址导航| 亚洲一级二级三级在线免费观看| 精品精品国产高清a毛片牛牛 | 奇米色777欧美一区二区| 中文字幕免费不卡在线| 在线不卡免费欧美| 久久成人综合网| 夜夜嗨av一区二区三区中文字幕 | 欧美综合一区二区三区| 国产精品一线二线三线| 国产精品久久免费看| 日韩一区二区中文字幕| 日本乱码高清不卡字幕| 日本不卡的三区四区五区| 中文字幕五月欧美| 欧美无砖专区一中文字| 成人久久18免费网站麻豆| 亚洲精品免费电影| 欧美一卡在线观看| 成人性视频网站| 精品一区在线看| 国产精品久久久久永久免费观看 | 色欧美片视频在线观看在线视频| 国产伦精一区二区三区| 中文字幕在线视频一区| 久久久www成人免费无遮挡大片| 欧美日韩视频在线观看一区二区三区| 波多野结衣亚洲| 日韩精品一卡二卡三卡四卡无卡| 日韩美女视频19| 欧美一区二区视频免费观看| 欧美亚洲禁片免费| 色婷婷久久综合| 99久久综合国产精品| 国产成人aaa| 成人黄色片在线观看| 丝袜美腿高跟呻吟高潮一区| 洋洋成人永久网站入口| 亚洲精品中文在线观看| 亚洲欧美国产毛片在线| 亚洲乱码中文字幕| 亚洲免费色视频| 亚洲午夜精品网| 国产日韩v精品一区二区| 精品视频在线免费| 欧美精三区欧美精三区| 欧美挠脚心视频网站| 99久久综合狠狠综合久久| 99久久99久久综合| 在线观看不卡一区| 欧美日韩精品免费| 日韩视频国产视频| 国产欧美精品在线观看| 国产精品麻豆一区二区| 一区二区三区免费在线观看| 亚洲综合av网| 久久精品国产精品青草| 国产乱人伦精品一区二区在线观看| 国产精品一二三四五| 波多野结衣在线一区| 欧美性一二三区| 日韩欧美一区电影| 日本一区二区三区国色天香 | 亚洲一二三区在线观看| 视频在线观看一区| 激情综合色播五月| 成人av在线播放网址| 欧美怡红院视频| 日韩欧美国产综合| 国产欧美一区二区精品仙草咪| 亚洲欧美自拍偷拍| 日韩高清一区二区| 粉嫩高潮美女一区二区三区| 色综合激情久久| 日韩欧美国产一区在线观看| 国产精品天干天干在观线| 亚洲国产精品久久人人爱| 久久99精品国产.久久久久久| 成人午夜免费av| 91精品国产综合久久久久久久 | 亚洲激情图片小说视频| 日韩高清电影一区| 不卡区在线中文字幕| 91精品欧美福利在线观看| 国产清纯美女被跳蛋高潮一区二区久久w| 亚洲免费观看高清完整版在线| 日本怡春院一区二区| av电影天堂一区二区在线观看| 欧美日韩国产一二三| 国产精品国产a| 日本中文在线一区| 91久久精品一区二区三| 2023国产精品| 亚洲国产成人porn| 丁香亚洲综合激情啪啪综合| 欧美撒尿777hd撒尿| 国产精品美女久久久久久| 日韩av高清在线观看| 91国偷自产一区二区三区观看| 久久久精品综合| 天天色天天爱天天射综合| 麻豆成人免费电影| 日本久久一区二区三区| 国产女人水真多18毛片18精品视频| 亚洲1区2区3区4区| 极品美女销魂一区二区三区免费| 欧洲一区在线观看| 欧美国产日韩a欧美在线观看| 免费欧美在线视频| 欧美福利一区二区| 亚洲二区视频在线| 欧亚一区二区三区| 综合电影一区二区三区| 国产a精品视频| 国产午夜久久久久| 国产在线一区二区| 日韩美女视频一区二区在线观看| 亚洲第一成年网| 91电影在线观看| 亚洲综合在线免费观看| 色婷婷av一区二区三区gif| 国产精品视频观看| 成人亚洲精品久久久久软件| 久久久久国产精品麻豆| 国产露脸91国语对白| 精品国产成人在线影院| 国产主播一区二区| 久久日一线二线三线suv| 国产精品中文有码| 国产亚洲欧美色| 成人一区二区三区| 亚洲男人都懂的| 日本丶国产丶欧美色综合| 亚洲精品免费播放| 欧美色中文字幕| 爽好多水快深点欧美视频| 欧美一区二区三区精品| 美国欧美日韩国产在线播放| 精品国产91九色蝌蚪| 国产精品99久久久久久有的能看| 久久久精品蜜桃| 成人国产在线观看| 亚洲欧洲中文日韩久久av乱码| 91色|porny| 国产午夜精品美女毛片视频| 国产成人日日夜夜| 精品蜜桃在线看| 丰满放荡岳乱妇91ww| 亚洲免费在线播放| 欧美精品久久一区| 国产在线一区二区| 国产精品天干天干在线综合| 色悠悠久久综合| 日日夜夜免费精品| 久久综合久久99| 色综合久久99| 日韩精品一级中文字幕精品视频免费观看| 欧美一区二区美女| 国产成人av一区二区| 亚洲精品国产a| 精品成人私密视频| 99精品桃花视频在线观看| 日韩精品电影一区亚洲| 国产人妖乱国产精品人妖| 欧美在线观看一区| 国产主播一区二区|