use of com.vmware.photon.controller.model.adapters.vsphere.CustomProperties.DISK_PARENT_DIRECTORY in project photon-model by vmware.
the class InstanceClient method handleVirtualCDRomCleanup.
private void handleVirtualCDRomCleanup(List<DiskStateExpanded> disks) throws Exception {
if (CollectionUtils.isEmpty(disks)) {
return;
}
// Clean up ISO folders for the remaining disks if any
List<DiskStateExpanded> cdRomDisks = disks.stream().filter(disk -> disk.type == DiskType.CDROM).filter(disk -> CustomProperties.of(disk).getString(DISK_PARENT_DIRECTORY, null) != null).collect(Collectors.toList());
if (CollectionUtils.isEmpty(cdRomDisks)) {
return;
}
for (DiskStateExpanded ds : cdRomDisks) {
String path = CustomProperties.of(ds).getString(DISK_PARENT_DIRECTORY);
ClientUtils.deleteFolder(this.connection, this.ctx.datacenterMoRef, path);
}
}
Aggregations