Import Java.io.File;
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.ISVNOptions;
Import Org.tmatesoft.svn.core.wc.SVNClientManager;
Import org.tmatesoft.svn.core.wc.SVNRevision;
Import org.tmatesoft.svn.core.wc.SVNUpdateClient;
Import Org.tmatesoft.svn.core.wc.SVNWCUtil;
public class Testsvncheckout {//declares the SVN client management class private static Svnclientmanager Ourclientmanager; public static void Main (string[] args) throws Exception {//Initialize the library that supports the SVN://protocol.
This operation must be performed first.
Davrepositoryfactory.setup ();
Correlation variable assignment Svnurl repositoryurl = null; try {repositoryurl = svnurl.parseuriencoded ("http://localhost/svn/test/svnclient/WebRoot/index.jsp");} catch (
Svnexception e) {//} String name = ' Liuyua ';
String password = "Liuyua";
String Version = "5675";
Isvnoptions options = Svnwcutil.createdefaultoptions (true); instance of the GuestUser-side Management class Ourclientmanager = Svnclientmanager.newinstance (defaultsvnoptions) options, name, password);
The directory File wcdir = new File ("e:/test/") to which you want to check out the contents of the version library;
Obtain an instance of the Updateclient class from the client management class.
Svnupdateclient updateclient = Ourclientmanager.getupdateclient ();
* * Sets externals not to be ignored during the checkout/Updateclient.setignoreexternals (FALSE);
System.out.println ("Start");
Performs a check out operation that returns the version number of the working copy. Long workingversion= updateclient.doexport (Repositoryurl, Wcdir, Svnrevision.head, Svnrevision.parse (version), "",
True, false); System.out.println ("Version:" +workingversion+ check out to directory: "+wcdir+".)
"); }