DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Keep Your Application Secrets Secret
  • Dust Actors and Large Language Models: An Application
  • How To Validate Names Using Java
  • High-Performance Java Serialization to Different Formats

Trending

  • Fix the Target, Precompute Once: A Backend-Free Word-Ladder Solver With a BFS Distance Field
  • Multi-Agent Orchestration on AWS With AgentCore Runtime and A2A
  • Zone-Aware Routing in Kubernetes: Reducing Latency, Improving Resilience, and Lowering Cloud Costs
  • Building a Real Pipeline With senro: Monorepos, Caching, and Triggers

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Data Engineering
  3. Databases
  4. SVNKit: Tame Subversion with Java!

SVNKit: Tame Subversion with Java!

By 
Alexander Kitaev
·
Feb. 26, 08 · News
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
11.4K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

SVNKitis an Open Source pure Java Subversion library. SVNKit literally brings Subversion, popular open source version control system, to the Java world.

With SVNKit you can do the following:

All standard Subversion operations:

For instance, the following snipped checks out project from repository:

   File dstPath = new File("c:/svnkit");   SVNURL url = SVNURL.       parseURIEncoded("http://svn.svnkit.com/repos/svnkit/branches/1.1.x/");   SVNClientManager cm = SVNClientManager.newInstance();   SVNUpdateClient uc = cm.getUpdateClient();   uc.doCheckout(url, dstPath, SVNRevision.UNDEFINED, SVNRevision.HEAD, true);

Updates it to the latest revision:

   uc.doUpdate(dstPath, SVNRevision.HEAD, true); 

And finally commits local changes in "www" subdirectory if there are any:

   SVNCommitClient cc = cm.getCommitClient();   cc.doCommit(new File[] {new File(dstPath, "www")}, false, "message", false, true);

SVNKit supports all standard Subversion operations and compatible with the latest version of Subversion.

Access Subversion repository directly:

Some applications will benefit from working with repository directly, without keeping working copy locally. Example below displays list of files in "www" directory.

   SVNURL url = SVNURL.parseURIEncoded("http://svn.svnkit.com/repos/svnkit/branches/1.1.x/");   SVNRepository repos = SVNRepositoryFactory.create(url);   long headRevision = repos.getLatestRevision();   Collection entriesList = repos.getDir("www", headRevision, null, (Collection) null);   for (Iterator entries = entriesList.iterator(); entries.hasNext();) {        SVNDirEntry entry = (SVNDirEntry) entries.next();        System.out.println("entry: " + entry.getName());        System.out.println("last modified at revision: " + entry.getDate() +                                         " by " + entry.getAuthor());   }

Direct repository access API allows to perform operations like update, commit, diff and many other. Additionaly to the performance benefits of the direct access to repository, this API makes it possible to version arbitrary objects or object models within Subevrsion repository, not only files from the file system.

Replace JNI Subversion bindings with SVNKit:

Native Subversion provides Java interface that works with Subversion binaries through JNI. In case you already using it or would like to use as an option, you may also use SVNKit through exactly the same interface. This way you'll let your application dynamically switch between JNI and SVNKit implementation of the same API or let your application work on the platforms where there are no native Subversion binaries. For example:

   // pure Java implementation of the standard Subversion Java interface    SVNClientInterface jniAPI = SVNClientImpl.newInstance();   byte[] contents =         jniAPI.fileContent("http://svn.svnkit.com/repos/svnkit/branches/1.1.x/changelog.txt",                Revision.HEAD); 

SVNKit is widely used in different applications, including IntelliJ IDEA, Eclipse Subversion integrations, SmartSVN, JDeveloper, bug tracking server side applications (e.g. Atlassian JIRA) and repository management and tracking tools (e.g. Atlassian FishEye) and many others.

Where to get more information:

Recently we've released SVNKit version 1.1.6 which is bugfix release. At http://svnkit.com/ you will find more information on that new version and, of course, downloads, documentation, source code example and articles explaining how to use SVNKit. In case of any questions you're welcome at our mailing list, or just contact us at [email protected]

SVNKit is widely used in different applications, including IntelliJ IDEA, Eclipse Subversion integrations, SmartSVN, JDeveloper, bug tracking server side applications (e.g. Atlassian JIRA) and repository management and tracking tools (e.g. Atlassian FishEye) and many others.

With best regards,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!

source control Java (programming language) application Open source Repository (version control) Tame (analytic tool)

Opinions expressed by DZone contributors are their own.

Related

  • Keep Your Application Secrets Secret
  • Dust Actors and Large Language Models: An Application
  • How To Validate Names Using Java
  • High-Performance Java Serialization to Different Formats

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook