Class SimpleJettyHTTPServer


  • public class SimpleJettyHTTPServer
    extends java.lang.Object
    Class to make a simple Jetty servlet. Two arguments: port name, and webapps root path. share/images is automatically added as /images.
    Since:
    3.0
    Author:
    Craig Macdonald
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.eclipse.jetty.server.Server webserver  
    • Constructor Summary

      Constructors 
      Constructor Description
      SimpleJettyHTTPServer​(java.lang.String bindAddress, int port, java.lang.String webappRoot)
      Create a new server, bound to the specified IP address (optional), the specified port, and serving from the specified directory
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.String[] args)
      main
      void start()
      start webserver
      void stop()
      stop webserver
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • webserver

        protected org.eclipse.jetty.server.Server webserver
    • Constructor Detail

      • SimpleJettyHTTPServer

        public SimpleJettyHTTPServer​(java.lang.String bindAddress,
                                     int port,
                                     java.lang.String webappRoot)
                              throws java.io.IOException
        Create a new server, bound to the specified IP address (optional), the specified port, and serving from the specified directory
        Parameters:
        bindAddress - - interface to bind to. Will bind to all addresses if null.
        port - - port to run the Jetty server on.
        webappRoot - - path location to run the webapps folder
        Throws:
        java.io.IOException - if problem in binding
    • Method Detail

      • start

        public void start()
                   throws java.lang.Exception
        start webserver
        Throws:
        java.lang.Exception
      • stop

        public void stop()
                  throws java.lang.Exception
        stop webserver
        Throws:
        java.lang.Exception
      • main

        public static void main​(java.lang.String[] args)
                         throws java.lang.Exception
        main
        Parameters:
        args -
        Throws:
        java.lang.Exception