Package org.terrier.utility
Class SimpleJettyHTTPServer
- java.lang.Object
-
- org.terrier.utility.SimpleJettyHTTPServer
-
public class SimpleJettyHTTPServer extends java.lang.ObjectClass 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSimpleJettyHTTPServer.Command
-
Field Summary
Fields Modifier and Type Field Description protected org.eclipse.jetty.server.Serverwebserver
-
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 voidmain(java.lang.String[] args)mainvoidstart()start webservervoidstop()stop webserver
-
-
-
Constructor Detail
-
SimpleJettyHTTPServer
public SimpleJettyHTTPServer(java.lang.String bindAddress, int port, java.lang.String webappRoot) throws java.io.IOExceptionCreate 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.Exceptionstart webserver- Throws:
java.lang.Exception
-
stop
public void stop() throws java.lang.Exceptionstop webserver- Throws:
java.lang.Exception
-
main
public static void main(java.lang.String[] args) throws java.lang.Exceptionmain- Parameters:
args-- Throws:
java.lang.Exception
-
-