*
* @return whether one should check out.
*/
protected boolean baseDirChecks(File baseDir) {
if (!baseDir.isDirectory()) {
throw new AjxpDriverException("Base path " + baseDir
+ " is not a directory.");
}
try {// retrieves SVN infos
SVNInfo info = manager.getWCClient().doInfo(baseDir,
SVNRevision.WORKING);
SVNURL baseUrlTemp = info.getURL();
if (baseUrl != null) {
if (!baseUrl.equals(baseUrlTemp)) {
throw new AjxpDriverException(
"SVN URL of the working copy "
+ baseUrlTemp
+ " is not compatible with provided baseUrl "
+ baseUrl);
}
} else {
this.baseUrl = baseUrlTemp;
}
return false;
} catch (SVNException e) {// no info retrieved
log
.warn("Could not retrieve SVN info from "
+ baseDir
+ "("
+ e.getMessage()
+ "). Guess that it is and empty dir and try to check out from provided URL.");
if (baseDir.listFiles().length != 0) {
throw new AjxpDriverException("Base dir " + baseDir
+ " is not a working copy and not an empty dir.");
}
return true;
}
}