0

As I am new to this SVNKIT . Please any one Can provide me the code for creating an new text file SVN repository .

Eg: file:///E:/SVN/IDS/MSCVE

I want to add a new text file in the MSCVE folder.

it has to look like the below tree structure

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

Thanks In Advance.

edorian
  • 38,542
  • 15
  • 125
  • 143
user1053424
  • 39
  • 1
  • 5
  • As SVN is just like a folders in PC. Code will be similar, as you create file in java. http://docs.oracle.com/javase/tutorial/essential/io/file.html – Muhammad Imran Tariq Dec 12 '11 at 10:02

1 Answers1

0

Have you tried following the instructions in the SVNKit Wiki? See Committing To A Repository.

The following code adds the file nodeC/itemC2, adds the text and then changes some properties on it:

//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" );
Matthew Farwell
  • 60,889
  • 18
  • 128
  • 171