@Override public long getVirtualSize(File file) { try { long size = getTemplateVirtualSize(file.getParent(), file.getName()); return size; } catch (Exception e) { s_logger.info("[ignored]" + "failed to get template virtual size for vmdk: " + e.getLocalizedMessage()); } return file.length(); }
@Override public FormatInfo process(String templatePath, ImageFormat format, String templateName) throws InternalErrorException { return process(templatePath, format, templateName, 0); }
processor = new RawImageProcessor(); } else if (format == ImageFormat.VMDK) { processor = new VmdkProcessor();
_processors.put("OVA Processor", processor); processor = new VmdkProcessor(); processor.configure("VMDK Processor", params); _processors.put("VMDK Processor", processor);
@Override public FormatInfo process(String templatePath, ImageFormat format, String templateName, long processTimeout) throws InternalErrorException { if (format != null) { if (s_logger.isInfoEnabled()) { s_logger.info("We currently don't handle conversion from " + format + " to VMDK."); } return null; } s_logger.info("Template processing. templatePath: " + templatePath + ", templateName: " + templateName); String templateFilePath = templatePath + File.separator + templateName + "." + ImageFormat.VMDK.getFileExtension(); if (!_storage.exists(templateFilePath)) { if (s_logger.isInfoEnabled()) { s_logger.info("Unable to find the vmware template file: " + templateFilePath); } return null; } FormatInfo info = new FormatInfo(); info.format = ImageFormat.VMDK; info.filename = templateName + "." + ImageFormat.VMDK.getFileExtension(); info.size = _storage.getSize(templateFilePath); info.virtualSize = getTemplateVirtualSize(templatePath, info.filename); return info; }