Class Win32_LogicalDiskToPartition
java.lang.Object
com.ferrumx.system.associatedclasses.Win32_LogicalDiskToPartition
This class relates associates drive letters to partitions of a drive, if
available. The list of Partitions of a particular Drive queried from
Win32_DiskDriveToDiskPartition
is fetched into this class which then
fetches the letters assigned to a partition.- Author:
- Egg-03
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getDriveLetter
(String partitionID) Assigns partition letters to drive partitions
-
Method Details
-
getDriveLetter
public static String getDriveLetter(String partitionID) throws IOException, IndexOutOfBoundsException, ShellException, InterruptedException Assigns partition letters to drive partitions- Parameters:
partitionID
- the partition of a drive, fetched fromWin32_DiskDriveToDiskPartition.getPartitionList(String)
- Returns:
- the drive letter associated with the current partition. If no letters are assigned, it returns "N/A"
- Throws:
IOException
- in case of general I/O errorsIndexOutOfBoundsException
- in case of text parsing issues from 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();
-