String[] folderNames = path.split("/");
List<String> folderList = new ArrayList<String>();
for (int i = 0; i < folderNames.length - 1; i++) {
folderList.add(folderNames[i]);
}
CreateVMFolderSP sp =
new CreateVMFolderSP(templateVm.getDatacenter(), null,
folderList);
storeProcedures[0] = sp;
Map<String, Folder> folders =
executeFolderCreationProcedures(cluster, storeProcedures);
for (String name : folders.keySet()) {
clusterFolder = folders.get(name);
break;
}
}
logger.info("createVcFolders, start to create group Folders.");
storeProcedures = new Callable[cluster.getNodeGroups().length];
int i = 0;
for (NodeGroupCreate group : cluster.getNodeGroups()) {
List<String> folderList = new ArrayList<String>();
folderList.add(group.getName());
CreateVMFolderSP sp =
new CreateVMFolderSP(templateVm.getDatacenter(), clusterFolder,
folderList);
storeProcedures[i] = sp;
i++;
}
return executeFolderCreationProcedures(cluster, storeProcedures);