I'm using SVNKit and the only way I found out to test Authentification to the server is by using method testConnection()
of class SVNRepository
.
The method doesn't return a boolean but throws an Exception.
public abstract void testConnection()
throws SVNException
The problem is that, instead of being catch, I get a coldfusion error :
Here is my code:
clientManager = CreateObject("java", "org.tmatesoft.svn.core.wc.SVNClientManager").newInstance();
authManagerJO = CreateObject("java", "org.tmatesoft.svn.core.wc.SVNWCUtil").
createDefaultAuthenticationManager(ARGUMENTS.username, JavaCast("String", ARGUMENTS.password));
authManagerJO.setAuthenticationForced(true);
clientManager.setAuthenticationManager(authManagerJO);
svnDavRepoFactory = CreateObject("java", "org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory").setup();
repositoryUrlJO = CreateObject("java", "org.tmatesoft.svn.core.SVNURL").parseURIDecoded(APPLICATION.svn_repository_audifiles);
svnRepository = clientManager.createRepository(repositoryUrlJO, true);
try{
svnRepository.testConnection();
}
catch (Exception e){
svnRepository = "";
}