< prev index next >

src/java.desktop/unix/classes/sun/print/UnixPrintService.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 177,187 **** Sides.class, }; private static int MAXCOPIES = 1000; ! private static final MediaSizeName mediaSizes[] = { MediaSizeName.NA_LETTER, MediaSizeName.TABLOID, MediaSizeName.LEDGER, MediaSizeName.NA_LEGAL, MediaSizeName.EXECUTIVE, --- 177,187 ---- Sides.class, }; private static int MAXCOPIES = 1000; ! private static final MediaSizeName[] mediaSizes = { MediaSizeName.NA_LETTER, MediaSizeName.TABLOID, MediaSizeName.LEDGER, MediaSizeName.NA_LEGAL, MediaSizeName.EXECUTIVE,
*** 222,232 **** return name; } private PrinterIsAcceptingJobs getPrinterIsAcceptingJobsSysV() { String command = "/usr/bin/lpstat -a " + printer; ! String results[]= PrintServiceLookupProvider.execCmd(command); if (results != null && results.length > 0) { if (results[0].startsWith(printer + " accepting requests")) { return PrinterIsAcceptingJobs.ACCEPTING_JOBS; } --- 222,232 ---- return name; } private PrinterIsAcceptingJobs getPrinterIsAcceptingJobsSysV() { String command = "/usr/bin/lpstat -a " + printer; ! String[] results= PrintServiceLookupProvider.execCmd(command); if (results != null && results.length > 0) { if (results[0].startsWith(printer + " accepting requests")) { return PrinterIsAcceptingJobs.ACCEPTING_JOBS; }
*** 255,265 **** PrintServiceLookupProvider.getBSDCommandIndex(); } String command = "/usr/sbin/lpc status " + printer + lpcStatusCom[PrintServiceLookupProvider.cmdIndex]; ! String results[]= PrintServiceLookupProvider.execCmd(command); if (results != null && results.length > 0) { if (PrintServiceLookupProvider.cmdIndex == PrintServiceLookupProvider.BSD_LPD_NG) { if (results[0].startsWith("enabled enabled")) { --- 255,265 ---- PrintServiceLookupProvider.getBSDCommandIndex(); } String command = "/usr/sbin/lpc status " + printer + lpcStatusCom[PrintServiceLookupProvider.cmdIndex]; ! String[] results= PrintServiceLookupProvider.execCmd(command); if (results != null && results.length > 0) { if (PrintServiceLookupProvider.cmdIndex == PrintServiceLookupProvider.BSD_LPD_NG) { if (results[0].startsWith("enabled enabled")) {
*** 303,313 **** } private PrinterIsAcceptingJobs getPrinterIsAcceptingJobsAIX() { // On AIX there should not be a blank after '-a'. String command = "/usr/bin/lpstat -a" + printer; ! String results[]= PrintServiceLookupProvider.execCmd(command); // Remove headers and bogus entries added by remote printers. results = filterPrinterNamesAIX(results); if (results != null && results.length > 0) { --- 303,313 ---- } private PrinterIsAcceptingJobs getPrinterIsAcceptingJobsAIX() { // On AIX there should not be a blank after '-a'. String command = "/usr/bin/lpstat -a" + printer; ! String[] results= PrintServiceLookupProvider.execCmd(command); // Remove headers and bogus entries added by remote printers. results = filterPrinterNamesAIX(results); if (results != null && results.length > 0) {
*** 353,363 **** } } private QueuedJobCount getQueuedJobCountSysV() { String command = "/usr/bin/lpstat -R " + printer; ! String results[]= PrintServiceLookupProvider.execCmd(command); int qlen = (results == null) ? 0 : results.length; return new QueuedJobCount(qlen); } --- 353,363 ---- } } private QueuedJobCount getQueuedJobCountSysV() { String command = "/usr/bin/lpstat -R " + printer; ! String[] results= PrintServiceLookupProvider.execCmd(command); int qlen = (results == null) ? 0 : results.length; return new QueuedJobCount(qlen); }
*** 370,380 **** } int qlen = 0; String command = "/usr/sbin/lpc status " + printer + lpcQueueCom[PrintServiceLookupProvider.cmdIndex]; ! String results[] = PrintServiceLookupProvider.execCmd(command); if (results != null && results.length > 0) { String queued; if (PrintServiceLookupProvider.cmdIndex == PrintServiceLookupProvider.BSD_LPD_NG) { --- 370,380 ---- } int qlen = 0; String command = "/usr/sbin/lpc status " + printer + lpcQueueCom[PrintServiceLookupProvider.cmdIndex]; ! String[] results = PrintServiceLookupProvider.execCmd(command); if (results != null && results.length > 0) { String queued; if (PrintServiceLookupProvider.cmdIndex == PrintServiceLookupProvider.BSD_LPD_NG) {
*** 398,408 **** } private QueuedJobCount getQueuedJobCountAIX() { // On AIX there should not be a blank after '-a'. String command = "/usr/bin/lpstat -a" + printer; ! String results[]= PrintServiceLookupProvider.execCmd(command); // Remove headers and bogus entries added by remote printers. results = filterPrinterNamesAIX(results); int qlen = 0; --- 398,408 ---- } private QueuedJobCount getQueuedJobCountAIX() { // On AIX there should not be a blank after '-a'. String command = "/usr/bin/lpstat -a" + printer; ! String[] results= PrintServiceLookupProvider.execCmd(command); // Remove headers and bogus entries added by remote printers. results = filterPrinterNamesAIX(results); int qlen = 0;
*** 792,802 **** } } } else if (category == JobName.class) { return new JobName("Java Printing", null); } else if (category == JobSheets.class) { ! JobSheets arr[] = new JobSheets[2]; arr[0] = JobSheets.NONE; arr[1] = JobSheets.STANDARD; return arr; } else if (category == RequestingUserName.class) { String userName = ""; --- 792,802 ---- } } } else if (category == JobName.class) { return new JobName("Java Printing", null); } else if (category == JobSheets.class) { ! JobSheets[] arr = new JobSheets[2]; arr[0] = JobSheets.NONE; arr[1] = JobSheets.STANDARD; return arr; } else if (category == RequestingUserName.class) { String userName = "";
< prev index next >