}
private void validate() throws Exception {
// Check template and archive
if (!(new File(_templateDir)).exists()) {
throw new ValidationException("EXCEPTION_TEMPLATES_NOT_FOUND");
}
if (!(new File(_airTemplate)).exists()) {
throw new ValidationException("EXCEPTION_TEMPLATES_NOT_FOUND");
}
if (!SessionManager.getInstance().isPlayBook()) {
if (_rapc.length() == 0 ) {
throw new ValidationException("EXCEPTION_RAPC_NOT_FOUND");
} else {
if (!_rapc.equals("rapc.exe") && !_rapc.equals("rapc")) {
if (!(new File(_rapc)).exists()) {
throw new ValidationException("EXCEPTION_RAPC_NOT_FOUND");
}
}
}
// Check javac path
if (_javac == null || _javac.length() == 0 ) {
// For tooling, they will set _javac to empty if they find javac.exe in "Path" environment variable
// Rapc doesn't depend on this value to locate javac.exe, either
//throw new ValidationException("EXCEPTION_JAVAC_NOT_FOUND");
} else {
if (!_javac.equals("javac.exe") && !_javac.equals("javac")) {
String javac = _javac;
if (javac.startsWith("\"") && javac.endsWith("\"")) {
javac = javac.substring(1, javac.length() - 1);
}
if (!(new File(javac)).exists()) {
throw new ValidationException("EXCEPTION_JAVAC_NOT_FOUND");
}
}
}
}
// Tablet SDK path should be absolute and existing
if ((new File(_tabletSDK).isAbsolute()) && (new File(_tabletSDK)).exists()) {
} else {
throw new ValidationException("EXCEPTION_TABLET_SDK_NOT_FOUND");
}
}