0

I am able to read a contents from SVN repository file by file using SVN kit. But my requirement is to download entire project from SVN repository to my local directory Using SVN kit java code for source code analysis. So How can I achieve this. I have seen examples regarding reading files and directories not downloading projects. Please any one can help me

user2215139
  • 1,805
  • 2
  • 18
  • 24
  • Isn't that more or less exactly what you asked earlier: http://stackoverflow.com/questions/16536149/how-to-get-all-files-and-directories-from-the-svn-repository-using-java – maba May 14 '13 at 07:57
  • ya but i am able to find connection to svn repository and able to get file contents. Till that it suggestion worked fine. But for downloading I am spending time but unable to get example samples – user2215139 May 14 '13 at 08:07
  • From the SVNKit web site: http://wiki.svnkit.com/Managing_A_Working_Copy – Gilbert Le Blanc May 14 '13 at 08:44
  • Thank you Gilbert Le Blanc it worked for me. You saved my time – user2215139 May 14 '13 at 09:45

1 Answers1

0

SVNClientManager is a part of old SVNKit API. As SVNKit developer, I would recommend you to prefer new SVNKit API based on SvnOperationFactory class (because the old API is implemented via the new one and for some API classes this API-to-API conversion caused problems):

final SvnOperationFactory svnOperationFactory = new SvnOperationFactory();
try {
    final SvnCheckout checkout = svnOperationFactory.createCheckout();
    checkout.setSource(SvnTarget.fromURL(url));
    checkout.setSingleTarget(SvnTarget.fromFile(workingCopyDirectory));
    checkout.run();
} finally {
    svnOperationFactory.dispose();
}

If you don't need ".svn" directories, use SvnOperationFactory#createExport method instead.

Dmitry Pavlenko
  • 8,530
  • 3
  • 30
  • 38