SVN check-out with SVNKit

Posted on 07-01-2013 14:44 by graham
This tutorial describes how to check out an SVN repository which needs authentication.
// turn on DAV support if you are connecting to a DAV repository
DAVRepositoryFactory.setup();

SVNClientManager clientManager = SVNClientManager.newInstance();

ISVNAuthenticationManager authManager = new BasicAuthenticationManager("username", "password");
clientManager.setAuthenticationManager(authManager);

SVNUpdateClient updateClient = clientManager.getUpdateClient();

try
{
SVNURL url = SVNURL.parseURIEncoded("http://<repo-url>");
updateClient.doCheckout(url, "/local/repo/directory", SVNRevision.UNDEFINED, SVNRevision.HEAD, true);
}
catch (SVNException e)
{
...
}
Comments

 

Add comment

Has this tutorial been helpful to you? Or do you see anything wrong? We appreciate your opinion!
Your comment:
Show formatting hints
HTML is disallowed, but in your text you can use the following markup
  • [code][/code] for a block of code
  • [tt][/tt] for inline code
  • [link]link href|link anchor[/link] for links
  • [b][/b] for bold text
Email:
+ Ask a question
If you have a technical question related to programming and computers, ask it here. Other users will help you solve it!
Unanswered questions
Share your knowledge by helping others solve their problems