Map<String, VirtualDiskDescType> diskIdToDiskFormat =
new HashMap<String, VirtualDiskDescType>();
Map<String, FileType> fileIdToFileType = new HashMap<String, FileType>();
Map<String, List<String>> diskIdToVSs = new HashMap<String, List<String>>();
Map<String, TemplateDto> requiredByVSs = new HashMap<String, TemplateDto>();
DiskSectionType diskSectionType;
try
{
ContentType contentType = OVFEnvelopeUtils.getTopLevelVirtualSystemContent(envelope);
ProductSectionType product =
OVFEnvelopeUtils.getSection(contentType, ProductSectionType.class);
OperatingSystemSectionType ossection = null;
try
{
ossection =
OVFEnvelopeUtils.getSection(contentType, OperatingSystemSectionType.class);
}
catch (Exception e) // no such section
{
}
String description = null;
if (product.getInfo() != null && product.getInfo().getValue() != null)
{
description = product.getInfo().getValue();
}
String categoryName = null;
if (product.getOtherAttributes().containsKey(new QName("CategoryName")))
{
categoryName = product.getOtherAttributes().get(new QName("CategoryName"));
}
String iconPath = getIconPath(product, fileIdToFileType, ovfId);
diskSectionType = OVFEnvelopeUtils.getSection(envelope, DiskSectionType.class);
for (FileType fileType : envelope.getReferences().getFile())
{
fileIdToFileType.put(fileType.getId(), fileType);
}
// Create a hash
for (VirtualDiskDescType virtualDiskDescType : diskSectionType.getDisk())
{
diskIdToDiskFormat.put(virtualDiskDescType.getDiskId(), virtualDiskDescType);
}
if (contentType instanceof VirtualSystemType)