Class VertxBrowserHelper.Server

  • Enclosing class:
    VertxBrowserHelper

    public class VertxBrowserHelper.Server
    extends java.lang.Object
    A http server that gets and sets responses.
    • Constructor Summary

      Constructors 
      Constructor Description
      Server​(int port)
      Instantiate a http server that listens only on localhost.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addResource​(java.lang.String path, java.lang.Object resource, java.lang.String contentType)
      Add a resource to be served by the server.
      void setResponse​(java.lang.String response)
      Set the response.
      void shutdown()
      Shut down the server, if running.
      • Methods inherited from class java.lang.Object

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

      • Server

        public Server​(int port)
        Instantiate a http server that listens only on localhost.
        Parameters:
        port - The port number
    • Method Detail

      • addResource

        public void addResource​(java.lang.String path,
                                java.lang.Object resource,
                                java.lang.String contentType)
        Add a resource to be served by the server.
        Parameters:
        path - The path to the resource.
        resource - The resource to serve upon a request for this path.
        contentType - The content type.
      • setResponse

        public void setResponse​(java.lang.String response)
        Set the response.
        Parameters:
        response - The response.
      • shutdown

        public void shutdown()
        Shut down the server, if running.