logger.info("Missing requirements have been provisioned");
}
StagedData[] stagedData = sElem.getStagedData();
for (StagedData data : stagedData) {
DownloadRecord dlRec;
if (data.getInstallRoot().startsWith(File.separator)) {
DownloadManager dlManager = new DownloadManager(data);
dlRec = dlManager.download();
dlRecords.add(dlRec);
} else {
String provisionRoot = computeResource.getPersistentProvisioningRoot();
DownloadManager dlManager = new DownloadManager(provisionRoot, data);
dlRec = dlManager.download();
dlRecords.add(dlRec);
}
if (data.getPerms() != null) {
if (OperatingSystemType.isWindows()) {
logger.warn("Cannot apply permissions [{}] to StagedData on Windows", data.getPerms());
} else {
File toChmod;
StringBuilder perms = new StringBuilder();
if (dlRec.unarchived()) {
toChmod = new File(dlRec.getPath());
perms.append("-R ");
} else {
toChmod = new File(FileUtils.makeFileName(dlRec.getPath(), dlRec.getName()));
}
perms.append(data.getPerms());
logger.info("Applying permissions [{}] to data staged at [{}]",
perms.toString(), FileUtils.getFilePath(toChmod));
Util.chmod(toChmod, perms.toString());