Package org.terrier.utility
Class SimpleJettyHTTPServer
- java.lang.Object
-
- org.terrier.utility.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SimpleJettyHTTPServer.Command
-
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)
mainvoid
start()
start webservervoid
stop()
stop 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
-
-