Remote SVN administration
I'm writing a Java app that performs various SVN actions (commit, copy, etc) from a remote machine. I access SVN from my Java app using the SVNKit API.
I also need to perform some administration actions, such as creating users and repositories. These actions are not available via the SVNKit API, or even the SVN command-line interface. Normally these would be performed directly on the SVN server, using svnadmin or a GUI equivalent.
(It is possible with SVNKit to create a local repository, but I need to create a repository on a remote machine)
So it seems my options are:
Programatically connect from java app to svn server using SSH o开发者_如何学Pythonr similar, then use
Runtime.exec()
to runsvnadmin
Deploy a web application (like this one) on machine running svn server, then connect to it from java app using HTTP
Map a drive from java app machine to svn server machine (both are windows machines), then run
svnadmin
from the former, supplying the path to the latter as an argument
Is there any other way to perform these admin tasks from a remote machine?
Since svnadmin
does not itself work remotely (as stated explicitly in its documentation), your problem is no different from running any other local application from a remote computer.
BTW, your option 3 is not advisable:
Do not create a Berkeley DB repository on a network share—it cannot exist on a remote filesystem such as NFS, AFS, or Windows SMB. Berkeley DB requires that the underlying filesystem implement strict POSIX locking semantics, and more importantly, the ability to map files directly into process memory. Almost no network filesystems provide these features. If you attempt to use Berkeley DB on a network share, the results are unpredictable—you may see mysterious errors right away, or it may be months before you discover that your repository database is subtly corrupted.
精彩评论