All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sun.xml.ws.commons.virtualbox.IFloppyDrive Maven / Gradle / Ivy


package com.sun.xml.ws.commons.virtualbox;

import java.util.UUID;
import javax.xml.ws.WebServiceException;


/**
 * The IFloppyDrive interface represents the virtual floppy drive of the
 *       virtual machine. Used in {@link IMachine#FloppyDrive}.
 * 
 */
public class IFloppyDrive {

    public final VboxPortType port;
    public final String _this;

    public IFloppyDrive(String _this, VboxPortType port) {
        
        this._this = _this;
        this.port = port;
    
    }

    /**
     * Flag whether the floppy drive is enabled. If it is disabled,
     *         the floppy drive will not be reported to the guest.
     * 
     */
    public boolean getEnabled() {
        try {
            boolean retVal = port.iFloppyDriveGetEnabled(_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);
        }
    }

    /**
     * Flag whether the floppy drive is enabled. If it is disabled,
     *         the floppy drive will not be reported to the guest.
     * 
     */
    public void setEnabled(boolean value) {
        try {
            port.iFloppyDriveSetEnabled(_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);
        }
    }

    /**
     * Current drive state.
     * 
     */
    public DriveState getState() {
        try {
            DriveState retVal = port.iFloppyDriveGetState(_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);
        }
    }

    /**
     * Mounts the specified image.
     * 
     * @param imageId
     *     
     */
    public void mountImage(UUID imageId) {
        try {
            port.iFloppyDriveMountImage(_this, imageId.toString());
        } 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);
        }
    }

    /**
     * Captures the specified host drive.
     * 
     * @param drive
     *     
     */
    public void captureHostDrive(IHostFloppyDrive drive) {
        try {
            port.iFloppyDriveCaptureHostDrive(_this, ((drive == null)?null:drive._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);
        }
    }

    /**
     * Unmounts the currently mounted image/device.
     * 
     */
    public void unmount() {
        try {
            port.iFloppyDriveUnmount(_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);
        }
    }

    /**
     * Gets the currently mounted image ID.
     * 
     * @return
     *     
     */
    public IFloppyImage getImage() {
        try {
            String retVal = port.iFloppyDriveGetImage(_this);
            return new IFloppyImage(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);
        }
    }

    /**
     * Gets the currently mounted image ID.
     * 
     * @return
     *     
     */
    public IHostFloppyDrive getHostDrive() {
        try {
            String retVal = port.iFloppyDriveGetHostDrive(_this);
            return new IHostFloppyDrive(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);
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy