Search code examples
svnsvnkit

SVN API to find if dir is versioned or not


I am committing the files to SVN using the API available in SVNKit.

ourClientManager.getCommitClient().doCommit(mypaths, kpLocks, "", force-yes, recursive-true);

I want to find out if the directory of the file, is part of working copy or not, before checking in the file. Can you please suggest what API i can use to get this information.


Solution

  • You want to use status to figure this out:

    ourClientManager.getStatusClient().doStatus(path, false).isVersioned()

    If you want to figure out if more than one file is versioned you'll probably want to write an ISVNStatusHandler.

    Link to the SVNKit Documentation: http://svnkit.com/javadoc/org/tmatesoft/svn/core/wc/SVNStatusClient.html