
com.sun.xml.ws.commons.virtualbox.IVirtualDiskImage Maven / Gradle / Ivy
package com.sun.xml.ws.commons.virtualbox;
import java.math.BigInteger;
import javax.xml.ws.WebServiceException;
/**
* The IVirtualDiskImage interface represent a specific type ofthat uses VDI image files.
*
* The Virtual Disk Image (VDI) format is VirtualBox's native format for
* hard disk containers.
*
* Objects that support this interface also support theinterface.
*
* Hard disks using virtual disk images can be either opened usingor created from
* scratch using.
*
* When a new hard disk object is created from scratch, an image file for it
* is not automatically created. To do it, you need to specify a
* valid, and callor.
* When it is done, the hard disk object can be registered by callingand thento
* virtual machines.
*
* Theof the
* Virtual Disk Image is stored in the image file. For this reason,
* changing the value of this property requires the hard disk to be. The description
* of a registered hard disk can be changed only if a virtual machine
* using it is not running.
*
*/
public class IVirtualDiskImage {
public final VboxPortType port;
public final String _this;
public IVirtualDiskImage(String _this, VboxPortType port) {
this._this = _this;
this.port = port;
}
/**
* Full file name of the virtual disk image of this hard disk. For
* newly created hard disk objects, this value is.
*
* When assigning a new path, it can be absolute (full path) or relative
* to the. If only a file name without any path is given,
* thewill be used as a path to the image file.
*
* When reading this propery, a full path is always returned.
*
*/
public String getFilePath() {
try {
String retVal = port.iVirtualDiskImageGetFilePath(_this);
return retVal;
} catch (com.sun.xml.ws.commons.virtualbox.InvalidObjectFaultMsg e) {
throw new WebServiceException(e);
} catch (com.sun.xml.ws.commons.virtualbox.RuntimeFaultMsg e) {
throw new WebServiceException(e);
}
}
/**
* Full file name of the virtual disk image of this hard disk. For
* newly created hard disk objects, this value is.
*
* When assigning a new path, it can be absolute (full path) or relative
* to the. If only a file name without any path is given,
* thewill be used as a path to the image file.
*
* When reading this propery, a full path is always returned.
*
*/
public void setFilePath(String value) {
try {
port.iVirtualDiskImageSetFilePath(_this, value);
} catch (com.sun.xml.ws.commons.virtualbox.InvalidObjectFaultMsg e) {
throw new WebServiceException(e);
} catch (com.sun.xml.ws.commons.virtualbox.RuntimeFaultMsg e) {
throw new WebServiceException(e);
}
}
/**
* Whether the virual disk image is created or not. For newly
* created hard disk objects or after a successful invocation of, this value isuntiloris called.
*
*/
public boolean getCreated() {
try {
boolean retVal = port.iVirtualDiskImageGetCreated(_this);
return retVal;
} catch (com.sun.xml.ws.commons.virtualbox.InvalidObjectFaultMsg e) {
throw new WebServiceException(e);
} catch (com.sun.xml.ws.commons.virtualbox.RuntimeFaultMsg e) {
throw new WebServiceException(e);
}
}
/**
* Starts creating a dymically expanding hard disk image in the
* background. The previous image associated with this object, if
* any, must be deleted using, otherwise
* the operation will fail.
*
* @param size
* Maximum logical size of the hard disk in megabytes.
* @return
* Progress object to track the operation completion.
*/
public IProgress createDynamicImage(BigInteger size) {
try {
String retVal = port.iVirtualDiskImageCreateDynamicImage("_this", size);
return new IProgress(retVal, port);
} catch (com.sun.xml.ws.commons.virtualbox.InvalidObjectFaultMsg e) {
throw new WebServiceException(e);
} catch (com.sun.xml.ws.commons.virtualbox.RuntimeFaultMsg e) {
throw new WebServiceException(e);
}
}
/**
* Starts creating a fixed-size hard disk image in the background. The
* previous image, if any, must be deleted using, otherwise the operation will fail.
*
* @param size
* Logical size of the hard disk in megabytes.
* @return
* Progress object to track the operation completion.
*/
public IProgress createFixedImage(BigInteger size) {
try {
String retVal = port.iVirtualDiskImageCreateFixedImage("_this", size);
return new IProgress(retVal, port);
} catch (com.sun.xml.ws.commons.virtualbox.InvalidObjectFaultMsg e) {
throw new WebServiceException(e);
} catch (com.sun.xml.ws.commons.virtualbox.RuntimeFaultMsg e) {
throw new WebServiceException(e);
}
}
/**
* Deletes the existing hard disk image. The hard disk must not be
* registered within this VirtualBox installation, otherwise the
* operation will fail.
*
*/
public void deleteImage() {
try {
port.iVirtualDiskImageDeleteImage("_this");
} catch (com.sun.xml.ws.commons.virtualbox.InvalidObjectFaultMsg e) {
throw new WebServiceException(e);
} catch (com.sun.xml.ws.commons.virtualbox.RuntimeFaultMsg e) {
throw new WebServiceException(e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy