Package com.ferrumx.system.hardware
Class Win32_Printer
java.lang.Object
com.ferrumx.system.hardware.Win32_Printer
This class queries the Win32_Printer class of WMI and represents the
installed printers in your device.
Fetches the following properties: Name, HorizontalResolution, VerticalResolution, Capabilities, CapabilityDescriptions, Default, DriverName, Hidden, Local, Network, PortName, PrintProcessor, Shared, ShareName, SpoolEnabled, WorkOffline
- Author:
- Egg-03
-
Method Summary
Modifier and TypeMethodDescriptiongetCurrentPrinter
(String deviceID) This method returns Printer properties of the deviceID fetched to itThis method fetches a list of printer deviceIDs
-
Method Details
-
getDeviceIDList
public static List<String> getDeviceIDList() throws IOException, IndexOutOfBoundsException, ShellException, InterruptedExceptionThis method fetches a list of printer deviceIDs- Returns:
- a
List
of printer deviceIDs - Throws:
IOException
- re-throws the exception thrown byCIM_ML.getPropertyValue(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.getPropertyValue(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();
-
getCurrentPrinter
public static Map<String,String> getCurrentPrinter(String deviceID) throws IOException, IndexOutOfBoundsException, ShellException, InterruptedException This method returns Printer properties of the deviceID fetched to it- Parameters:
deviceID
- fetched fromgetDeviceIDList()
- Returns:
- a
Map
of the printer properties mentioned in the class description - 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();
-