How to access files in SVN using java

I need help from you, I want to open a file from SVN using java code, can someone tell me the file access stream, or can someone send me some sample code for this.

Can someone send me sample code to access svn via HTML using java.

+7
source share
4 answers

You need to look at SVNKIT, Subversion for Java . From there:

He supports

  • Access to the repository via http (s), svn, svn (+ ssh) and file protocols.
  • Working copy operations - all supported.
  • Storage administration: create, load, reset and play.
  • In addition to its own API, SVNKit implements the JavaHL API.
  • SVNKit is reportedly running on Windows, OSX, Linux, BSD, and OpenVMS.
  • SVNKit does not require its own binaries; it works out of the box.
  • Native Subversion configuration files are used by default.
  • The Java Subversion command line client is part of SVNKit.
  • The latest SVNKit supports Subversion 1.6.5.
+6
source

Although I do not use it for my projects, it seems that the following library is worth a look. http://svnkit.com/

+1
source

An easy way would be to run the svn from Java. For example, you can run the command

  svn cat yourfile.txt > /tmp/yourtemporaryplace.txt 

then Java will read /tmp/yourtemporaryplace.txt . Better yet, read from the process running svn cat yourfile.txt , as in this question on java popen

You can also use the Java library of the SVN client, for example svnkit

(PS I do not code in Java at all, just searched for you)

+1
source

If you do this at work and are not working on an open source project, I would move away from SVNKit. They call themselves open source, but will charge you if you use SVNKit for commercial purposes .

Another good option is Apache Maven SCM (source code manager). Documents are a little unstable, but it is really open source. Here is a link to their page with some SVN examples .

0
source

All Articles