Package com.ferrumx.system.hardware
Class Win32_DiskDrive
java.lang.Object
com.ferrumx.system.hardware.Win32_DiskDrive
This class contains methods that query Win32_DiskDrive class of WMI to fetch
Disk Information.
The class fetches the values of the following properties: Caption, Model, Size, FirmwareRevision, SerialNumber, Partitions, Status, InterfaceType, PNPDeviceID
- Author:
- Egg-03
-
Method Summary
Modifier and TypeMethodDescriptionFetches the Disk Details whose IDs were fetched using thegetDriveID()
methodFetches a list of Disk Drives based on their DeviceID property This method internally callsCIM_ML.getPropertiesAndTheirValues(String, String)
and passes the classname and the attributes mentioned in the class description as parameters
-
Method Details
-
getDriveID
public static List<String> getDriveID() throws IOException, IndexOutOfBoundsException, ShellException, InterruptedExceptionFetches a list of Disk Drives based on their DeviceID property This method internally callsCIM_ML.getPropertiesAndTheirValues(String, String)
and passes the classname and the attributes mentioned in the class description as parameters- Returns:
- a
List
of disk drive IDs - Throws:
IOException
- re-throws the exception thrown byCIM_ML.getPropertiesAndTheirValues(String, String)
when there are I/O Errors during streaming of data from and to Powershell and other generated filesIndexOutOfBoundsException
- re-throws the exception thrown byCIM_ML.getPropertiesAndTheirValues(String, String)
when there is a parsing error of data fetched from Windows PowershellShellException
- if any internal command used in the powershell throws errorsInterruptedException
- if the thread waiting for the process to exit, gets interrupted. When catching this exception, you may re-throw it's interrupted status by using Thread.currentThread().interrupt();
-
getDrive
public static Map<String,String> getDrive(String driveID) throws IOException, IndexOutOfBoundsException, ShellException, InterruptedException Fetches the Disk Details whose IDs were fetched using thegetDriveID()
method- Parameters:
driveID
- this parameter takes one Drive ID at a time from the drive ID list- Returns:
- a
Map
of Drive Details which contain the attributes mentioned in the class description, as a key-value pair - Throws:
IOException
- re-throws the exception thrown byCIM_ML.getPropertiesAndTheirValuesWhere(String, String, String, String)
when there are I/O Errors during streaming of data from and to Powershell and other generated filesIndexOutOfBoundsException
- re-throws the exception thrown byCIM_ML.getPropertiesAndTheirValuesWhere(String, String, String, String)
when there is a parsing error of data fetched from Windows PowershellShellException
- if any internal command used in the powershell throws errorsInterruptedException
- if the thread waiting for the process to exit, gets interrupted. When catching this exception, you may re-throw it's interrupted status by using Thread.currentThread().interrupt();
-