How to do authentication of a svn url with username and password without checking out the project
Now I am calling the doCheckout() method to authenticate. I don't want to download to local starge. I just want to do authentication.
My current code
public class SvnAuth {
private static SVNClientManager ourClientManager;
public boolean svnAuthentication(String svnLocation, String svnUserName,
String svnPassword, File file) throws SVNException {
DefaultSVNOptions options = SVNWCUtil.createDefaultOptions(true);
ourClientManager = SVNClientManager.newInstance(options, svnUserName,
svnPassword);
SVNUpdateClient updateClient = ourClientManager.getUpdateClient();
updateClient.setIgnoreExternals(false);
SVNRevision rev = SVNRevision.HEAD;
try {
long revision1 = updateClient.doCheckout(
SVNURL.parseURIEncoded(svnLocation), file, rev, rev, true);
} catch (SVNException e) {
SVNErrorMessage svnErrorMessage = e.getErrorMessage();
throw new SVNException(svnErrorMessage);
}
return true;
}
}
SVNKit version I am using is 1.7.4-v1