2011-12-12 154 views
0

由於我是這個SVNKIT的新手。請任何人可以提供我創建一個新的文本文件SVN存儲庫的代碼。如何使用SVNKIT在SVN中創建新的文本文件..?

如:file:///E:/SVN/IDS/MSCVE

我想添加一個新的文本文件中MSCVE文件夾中。

它看起來像下面的樹結構

file:///E:/SVN/IDS/MSCVE/newtextfile.txt 

在此先感謝。

+0

由於SVN就像在PC上的文件夾。代碼將與您在java中創建文件類似。 http://docs.oracle.com/javase/tutorial/essential/io/file.html –

回答

0

您是否嘗試過遵循SVNKit Wiki中的指示?請參閱Committing To A Repository

下面的代碼添加文件nodeC/itemC2,添加文本,然後改變它的一些特性:

//the second and the third parameters are the path and revision respectively 
//of the item's ancestor if the item is being added with history 
editor.addFile("nodeC/itemC2" , null , -1); 

baseChecksum = ...; 
editor.applyTextDelta("nodeC/itemC2" , baseChecksum); 

baseData = ...; 
workingData = ...; 
checksum = deltaGenerator.sendDelta("nodeC/itemC2" , baseData , 0 , workingData , editor , true); 
editor.closeFile("nodeC/itemC2" , checksum); 

editor.changeFileProperty("nodeC/itemC2" , "propName1" , "propValue1"); 
editor.changeFileProperty("nodeC/itemC2" , "propName2" , "propValue2"); 
+0

什麼是「baseData」和「workingData」? – KaiThomasWerther

相關問題