if (vmArcMgr == null || diskId < 0 ) {
logger_.warning("doCheck(): some parameters are null.");
return false;
}
ConfigGlobal cfgGlobal_ = vmArcMgr.getConfigGlobal();
if (cfgGlobal_ == null) { return false; }
ProfileGeneration profGen = vmArcMgr.getTargetGeneration();
if (profGen == null) { return false; }
String vmMoref = vmArcMgr.getMoref();
/* Get path list to generate the target vmdk file. */
List<String> pathList =
vmArcMgr.getDumpPathListForRestore(diskId);
/* debug */
StringBuffer sb = new StringBuffer();
sb.append
(String.format("----- Path list for disk %d -----\n", diskId));
for (String path : pathList) {
sb.append(path); sb.append("\n");
}
sb.append("------------------\n");
System.out.print(sb.toString());
/* Check all archive files is available. */
boolean ret = true;
for (String path: pathList) {
/* Path string is quated. */
path = FormatString.toUnquatedString(path);
if ((new File(path)).canRead() == false) {
System.out.printf("File %s is not available.\n", path);
ret = false;
}
}
String digestPath = vmArcMgr.getDigestPathForCheck(diskId);
if ((digestPath != null &&
(new File(digestPath)).canRead()) == false) {
System.out.printf("File %s is not available.\n", digestPath);
ret &= false;
}
if (ret == false) { return false; }
String vmdkBkp = cfgGlobal_.getVmdkBkpPath();
assert vmdkBkp != null;
/* Really check archive contents. */
List<String> cmds = new LinkedList<String>();
//cmds.add("echo");