String shortName = null;
final File epr = new File(eprPath);
final String dirName = epr.getParentFile().getName();
if (dirName.startsWith(HistoryUtil.historyClusterDirPrefix)) {
throw new ExecutionProblem("Cluster handles are not supported, " +
"use the \"--" + Opts.STATUS_CHECK_OPT_STRING +
"\" option by itself instead.");
}
if (dirName.startsWith(HistoryUtil.historyDirPrefix)) {
print.debugln("Surmising from EPR parent directory that " +
"short name is '" + dirName +
"' (used for printing only)");
shortName = dirName;
}
print.infoln("Querying for '" + dirName + "' information:");
print.infoln(" - Workspace handle (EPR): '" + eprPath + "'");
final FutureTask task =
new FutureTask(
new QueryTask(eprPath, idAuthz, shortName,
print));
this.executor.submit(task);
try {
final Integer retCode = (Integer) task.get();
if (retCode.intValue() != BaseClient.SUCCESS_EXIT_CODE) {
throw new ExitNow(retCode.intValue());
}
} catch (InterruptedException e) {
throw new ExecutionProblem(e.getMessage(), e);
} catch (ExecutionException e) {
throw new ExecutionProblem(e.getMessage(), e);
}
}