camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1177949 - in /camel/branches/camel-2.8.x: ./ components/camel-printer/src/main/java/org/apache/camel/component/printer/PrinterProducer.java
Date Sat, 01 Oct 2011 08:47:08 GMT
Author: davsclaus
Date: Sat Oct  1 08:47:08 2011
New Revision: 1177949

URL: http://svn.apache.org/viewvc?rev=1177949&view=rev
Log:
Merged revisions 1177948 via svnmerge from 
https://svn.apache.org/repos/asf/camel/trunk


Modified:
    camel/branches/camel-2.8.x/   (props changed)
    camel/branches/camel-2.8.x/components/camel-printer/src/main/java/org/apache/camel/component/printer/PrinterProducer.java

Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct  1 08:47:08 2011
@@ -1 +1 @@
-/camel/trunk:1177126,1177309,1177394,1177945
+/camel/trunk:1177126,1177309,1177394,1177945,1177948

Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.8.x/components/camel-printer/src/main/java/org/apache/camel/component/printer/PrinterProducer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/components/camel-printer/src/main/java/org/apache/camel/component/printer/PrinterProducer.java?rev=1177949&r1=1177948&r2=1177949&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/components/camel-printer/src/main/java/org/apache/camel/component/printer/PrinterProducer.java
(original)
+++ camel/branches/camel-2.8.x/components/camel-printer/src/main/java/org/apache/camel/component/printer/PrinterProducer.java
Sat Oct  1 08:47:08 2011
@@ -87,7 +87,15 @@ public class PrinterProducer extends Def
             printService = PrintServiceLookup.lookupDefaultPrintService();            
         } else {
             PrintService[] services = PrintServiceLookup.lookupPrintServices(null, null);
-            setPrinter("\\\\" + config.getHostname() + "\\" + config.getPrintername());
+            String name;
+            if (config.getHostname().equalsIgnoreCase("localhost")) {
+                // no hostname for localhost printers
+                name = config.getPrintername();
+            } else {
+                name = "\\\\" + config.getHostname() + "\\" + config.getPrintername();
+            }
+            log.debug("Using printer name: {}", name);
+            setPrinter(name);
             int position = findPrinter(services, printer);
             if (position < 0) {
                 throw new PrintException("No printer found with name: " + printer + ". Please
verify that the host and printer are registered and reachable from this machine.");



Mime
View raw message