// will switch over to using natively, they are basically identical.
public VMFile getOneFile(VirtualMachinePartition part)
throws CannotTranslateException {
if (part == null) {
throw new CannotTranslateException("null partition");
}
final _VMFile vmFile = this.repr._newVMFile();
vmFile.setRootFile(part.isRootdisk());
if (part.isReadwrite()) {
vmFile.setDiskPerms(VMFile.DISKPERMS_ReadWrite);
} else {
vmFile.setDiskPerms(VMFile.DISKPERMS_ReadOnly);
}
vmFile.setMountAs(part.getImagemount());
final int size = part.getBlankspace();
if (size > 0) {
vmFile.setBlankSpaceSize(size);
vmFile.setBlankSpaceName(null); // unknown
}
try {
final String unpropTargetStr = part.getAlternateUnpropTarget();
if (unpropTargetStr != null) {
vmFile.setUnpropURI(new URI(unpropTargetStr));
}
vmFile.setURI(new URI(part.getImage()));
} catch (URISyntaxException e) {
throw new CannotTranslateException(e.getMessage(), e);
}
return vmFile;
}