Class Lpstat
java.lang.Object
oshi.util.driver.unix.Lpstat
Utility to parse printer information from
lpstat and lpoptions commands. Shared fallback path for
both JNA and FFM implementations when libcups is unavailable.-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisLocalUri(String uri) Determine if a device URI represents a local printer.static Printer.PrinterStatusparseStatus(String line) Parse the printer status from an lpstat -p line.static StringparseStatusReason(String line) Parse the status reason from an lpstat -p line.static StringQuery the default printer name.Query the description map for all printers.static StringqueryDriver(String printerName) Query the driver name for a specific printer.Query the port (device URI) map for all printers.
-
Method Details
-
queryDefaultPrinter
Query the default printer name.- Returns:
- the default printer name, or empty string if none
-
queryPortMap
-
queryDescriptionMap
-
queryDriver
-
parseStatus
Parse the printer status from an lpstat -p line.- Parameters:
line- a single line fromlpstat -p- Returns:
- the parsed status
-
parseStatusReason
-
isLocalUri
Determine if a device URI represents a local printer.- Parameters:
uri- the device URI- Returns:
- true if the URI indicates a local printer
-