@Override public long getVirtualSize(File file) throws IOException { try { long size = getTemplateVirtualSize(file); return size; } catch (Exception e) { s_logger.info("[ignored]" + "failed to get template virtual size for VHD: " + 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 OVAProcessor(); } else if (format == ImageFormat.VHD) { processor = new VhdProcessor(); } else if (format == ImageFormat.RAW) { processor = new RawImageProcessor();
InputStream strm = fileStream; boolean isCompressed = checkCompressed(file.getAbsolutePath());
Processor processor = new VhdProcessor(); processor.configure("VHD Processor", params); _processors.put("VHD Processor", processor);
Processor processor = new VhdProcessor();
@Override public FormatInfo process(String templatePath, ImageFormat format, String templateName, long processTimeout) throws InternalErrorException { if (format != null) { s_logger.debug("We currently don't handle conversion from " + format + " to VHD."); return null; } String vhdPath = templatePath + File.separator + templateName + "." + ImageFormat.VHD.getFileExtension(); if (!_storage.exists(vhdPath)) { s_logger.debug("Unable to find the vhd file: " + vhdPath); return null; } File vhdFile = _storage.getFile(vhdPath); FormatInfo info = new FormatInfo(); info.format = ImageFormat.VHD; info.filename = templateName + "." + ImageFormat.VHD.getFileExtension(); info.size = _storage.getSize(vhdPath); try { info.virtualSize = getTemplateVirtualSize(vhdFile); } catch (IOException e) { s_logger.error("Unable to get the virtual size for " + vhdPath); throw new InternalErrorException("unable to get virtual size from vhd file"); } return info; }