// This is a message present to human. An unmentioned, third option
// is technically possible. It's more esoteric, but one could
// specify Opts.HISTORY_SUBDIR_OPT_STRING directly.
throw new ParameterProblem(action + " requires either " +
"'" + Opts.HANDLE_OPT_STRING +
"' or path to specific EPR file using '" +
Opts.EPR_FILE_OPT_STRING + "'");
}
if (historySubDir != null && eprGivenFilePath != null) {
throw new ParameterProblem(action + " will use either '" +
Opts.HISTORY_SUBDIR_OPT_STRING +
"' or '" + Opts.EPR_FILE_OPT_STRING +
"', but you've provided BOTH options.");
}
File f;
if (historySubDir != null) {
CloudClientUtil.verifyHistoryDir(historySubDir, false, false);
f = new File(historySubDir, HistoryUtil.SINGLE_EPR_FILE_NAME);
if (!CloudClientUtil.fileExistsAndReadable(f)) {
f = new File(historySubDir, HistoryUtil.ENSEMBLE_EPR_FILE_NAME);
if (CloudClientUtil.fileExistsAndReadable(f)) {
this.isClusterHandle = true;
} else {
throw new ParameterProblem("Cannot find or read any " +
"instance or cluster EPRs under '" +
historySubDir + "'\nPerhaps this launch did " +
"not succeed?");
}
}
} else {
f = new File(eprGivenFilePath);
if (!CloudClientUtil.fileExistsAndReadable(f)) {
throw new ParameterProblem("Cannot find or read '" +
eprGivenFilePath + "'");
}
}
String old = null;
if (this.specificEPRpath != null) {
old = this.specificEPRpath;
}
this.specificEPRpath = f.getAbsolutePath();
if (old != null) {
if (!old.equals(this.specificEPRpath)) {
throw new ParameterProblem(
"Unexpected with any input: specific EPR that was " +
"previously set is '" + old + "' but it is " +
"not the same as a repeat derivation which " +
"is '" + this.specificEPRpath + "'. Please " +
"send debug output file (in the history " +