JAL-629 Change all stdout and stderr output to use Console.outPrintln and Console...
[jalview.git] / src / jalview / httpserver / HttpServer.java
index 83f1519..b9adcc6 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b1)
- * Copyright (C) 2015 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
@@ -150,14 +150,14 @@ public class HttpServer
       contextHandlers = new HandlerCollection(true);
       server.setHandler(contextHandlers);
       server.start();
-      // System.out.println(String.format(
+      // jalview.bin.Console.outPrintln(String.format(
       // "HttpServer started with %d threads", server.getThreadPool()
       // .getThreads()));
       contextRoot = server.getURI();
     } catch (Exception e)
     {
-      System.err.println("Error trying to start HttpServer: "
-              + e.getMessage());
+      jalview.bin.Console.errPrintln(
+              "Error trying to start HttpServer: " + e.getMessage());
       try
       {
         server.stop();
@@ -195,14 +195,14 @@ public class HttpServer
     {
       for (String val : Collections.list(request.getHeaders(hdr)))
       {
-        System.out.println(hdr + ": " + val);
+        jalview.bin.Console.outPrintln(hdr + ": " + val);
       }
     }
     for (String param : Collections.list(request.getParameterNames()))
     {
       for (String val : request.getParameterValues(param))
       {
-        System.out.println(param + "=" + val);
+        jalview.bin.Console.outPrintln(param + "=" + val);
       }
     }
   }
@@ -221,7 +221,7 @@ public class HttpServer
           server.stop();
         } catch (Exception e)
         {
-          System.err.println("Error stopping Http Server on "
+          jalview.bin.Console.errPrintln("Error stopping Http Server on "
                   + server.getURI() + ": " + e.getMessage());
         }
       }
@@ -267,12 +267,12 @@ public class HttpServer
       ch.start();
     } catch (Exception e)
     {
-      System.err.println("Error starting handler for " + path + ": "
-              + e.getMessage());
+      jalview.bin.Console.errPrintln(
+              "Error starting handler for " + path + ": " + e.getMessage());
     }
 
     handler.setUri(this.contextRoot + ch.getContextPath().substring(1));
-    System.out.println("Jalview " + handler.getName()
+    jalview.bin.Console.outPrintln("Jalview " + handler.getName()
             + " handler started on " + handler.getUri());
   }
 
@@ -293,7 +293,7 @@ public class HttpServer
     {
       contextHandlers.removeHandler(ch);
       myHandlers.remove(handler);
-      System.out.println("Stopped Jalview " + handler.getName()
+      jalview.bin.Console.outPrintln("Stopped Jalview " + handler.getName()
               + " handler on " + handler.getUri());
     }
   }