|
From: <ls...@us...> - 2011-07-31 13:43:50
|
Revision: 5839
http://jnode.svn.sourceforge.net/jnode/?rev=5839&view=rev
Author: lsantha
Date: 2011-07-31 13:43:44 +0000 (Sun, 31 Jul 2011)
Log Message:
-----------
Added support for loading the removable media into a removable device.
Modified Paths:
--------------
trunk/core/src/driver/org/jnode/driver/RemovableDeviceAPI.java
trunk/fs/src/driver/org/jnode/driver/block/floppy/FloppyDriver.java
trunk/fs/src/driver/org/jnode/driver/block/scsi/cdrom/SCSICDROMDriver.java
trunk/fs/src/driver/org/jnode/driver/block/usb/storage/scsi/USBStorageSCSIDriver.java
Modified: trunk/core/src/driver/org/jnode/driver/RemovableDeviceAPI.java
===================================================================
--- trunk/core/src/driver/org/jnode/driver/RemovableDeviceAPI.java 2011-07-31 13:42:10 UTC (rev 5838)
+++ trunk/core/src/driver/org/jnode/driver/RemovableDeviceAPI.java 2011-07-31 13:43:44 UTC (rev 5839)
@@ -73,4 +73,12 @@
*/
public void eject()
throws IOException;
+
+ /**
+ * Eject this device.
+ *
+ * @throws IOException
+ */
+ public void load()
+ throws IOException;
}
Modified: trunk/fs/src/driver/org/jnode/driver/block/floppy/FloppyDriver.java
===================================================================
--- trunk/fs/src/driver/org/jnode/driver/block/floppy/FloppyDriver.java 2011-07-31 13:42:10 UTC (rev 5838)
+++ trunk/fs/src/driver/org/jnode/driver/block/floppy/FloppyDriver.java 2011-07-31 13:43:44 UTC (rev 5839)
@@ -290,6 +290,11 @@
throw new IOException("Unsupported operation");
}
+ @Override
+ public void load() throws IOException {
+ throw new IOException("Unsupported operation");
+ }
+
/**
* Test if the disk has been changed and/or the format of the loaded floppy
* is known. If the floppy has been changed or the format of the floppy is
Modified: trunk/fs/src/driver/org/jnode/driver/block/scsi/cdrom/SCSICDROMDriver.java
===================================================================
--- trunk/fs/src/driver/org/jnode/driver/block/scsi/cdrom/SCSICDROMDriver.java 2011-07-31 13:42:10 UTC (rev 5838)
+++ trunk/fs/src/driver/org/jnode/driver/block/scsi/cdrom/SCSICDROMDriver.java 2011-07-31 13:43:44 UTC (rev 5839)
@@ -239,6 +239,31 @@
}
/**
+ * Load this device.
+ *
+ * @throws IOException
+ */
+ public void load() throws IOException {
+ if (locked) {
+ throw new IOException("Device is locked");
+ }
+ final SCSIDevice dev = (SCSIDevice) getDevice();
+ try {
+ MMCUtils.startStopUnit(dev, CDBStartStopUnit.Action.LOAD, false);
+ } catch (SCSIException ex) {
+ final IOException ioe = new IOException();
+ ioe.initCause(ex);
+ throw ioe;
+ } catch (TimeoutException ex) {
+ final IOException ioe = new IOException();
+ ioe.initCause(ex);
+ throw ioe;
+ } catch (InterruptedException ex) {
+ throw new InterruptedIOException();
+ }
+ }
+
+ /**
* Process the changed flag.
*
* @throws IOException
Modified: trunk/fs/src/driver/org/jnode/driver/block/usb/storage/scsi/USBStorageSCSIDriver.java
===================================================================
--- trunk/fs/src/driver/org/jnode/driver/block/usb/storage/scsi/USBStorageSCSIDriver.java 2011-07-31 13:42:10 UTC (rev 5838)
+++ trunk/fs/src/driver/org/jnode/driver/block/usb/storage/scsi/USBStorageSCSIDriver.java 2011-07-31 13:43:44 UTC (rev 5839)
@@ -217,4 +217,9 @@
// TODO Auto-generated method stub
}
+
+ @Override
+ public void load() throws IOException {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|