List of usage examples for javax.print PrintService getName
public String getName();
From source file:org.springframework.integration.print.core.PrintServiceExecutor.java
public PrintServiceExecutor(String printerName) { if (!StringUtils.hasText(printerName)) { this.printService = PrintServiceLookup.lookupDefaultPrintService(); Assert.notNull(this.printService, "Did not find a the default print service."); } else {//from www .java2s . c o m PrintService matchingPrintService = null; for (PrintService printService : PrintServiceExecutor.getAvailablePrinterServices()) { if (printerName.equalsIgnoreCase(printService.getName())) { matchingPrintService = printService; break; } } this.printService = matchingPrintService; Assert.notNull(this.printService, String.format("Did not find the" + "print service for printer '%s'.", printerName)); } if (logger.isInfoEnabled()) { logger.info("Setting up print service for printer '" + this.printService.getName() + "'."); } else if (logger.isDebugEnabled()) { logger.debug(this.getPrinterInfo()); } }