Package nzilbb.webapp
Class StandAloneWebApp
- java.lang.Object
-
- nzilbb.util.CommandLineProgram
-
- nzilbb.webapp.StandAloneWebApp
-
- Direct Known Subclasses:
AnnotatorWebApp
@ProgramDescription("Utility for running stand-alone webapps") public class StandAloneWebApp extends CommandLineProgram
Utility for running stand-alone webapps.
-
-
Constructor Summary
Constructors Constructor Description StandAloneWebApp()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringContentTypeForName(String name)Determines the content-type for a given resource name, using the file extension.StringgetFinishedPath()Getter forfinishedPath: The URI path (excluding leading '/') for the request that terminates the web app.StringgetFinishedResponse()Getter forfinishedResponse: The HTML document to show when /finishedPathis called.IntegergetPort()Getter forport: Server port to listen on.StringgetQuery()Getter forquery: The query string to use when opening the web-app.FilegetRoot()Getter forroot: Root directory of webapp.static voidmain(String[] argv)Command-line entrypointStandAloneWebAppsetFinishedPath(String newFinishedPath)Setter forfinishedPath: The URI path (excluding leading '/') for the request that terminates the web app.StandAloneWebAppsetFinishedResponse(String newFinishedResponse)Setter forfinishedResponse: The HTML document to show when /finishedPathis called.StandAloneWebAppsetPort(Integer newPort)Setter forport: Server port to listen on.StandAloneWebAppsetQuery(String newQuery)Setter forquery: The query string to use when opening the web-app.StandAloneWebAppsetRoot(File newRoot)Setter forroot: Root directory of webapp.voidstart()Start handling requests-
Methods inherited from class nzilbb.util.CommandLineProgram
error, error, getUsage, getV, getVersion, interpretPropertiesParameters, message, processArguments, setUsage, setV, setVersion, warning, warning
-
-
-
-
Method Detail
-
main
public static void main(String[] argv)
Command-line entrypoint
-
getRoot
public File getRoot()
Getter forroot: Root directory of webapp.- Returns:
- Root directory of webapp.
-
setRoot
@Switch(value="Root folder of webapp", compulsory=true) public StandAloneWebApp setRoot(File newRoot)
Setter forroot: Root directory of webapp.- Parameters:
newRoot- Root directory of webapp.
-
getPort
public Integer getPort()
Getter forport: Server port to listen on.- Returns:
- Server port to listen on.
-
setPort
@Switch("Server port to listen on (default is 9000)") public StandAloneWebApp setPort(Integer newPort)
Setter forport: Server port to listen on.- Parameters:
newPort- Server port to listen on.
-
getQuery
public String getQuery()
Getter forquery: The query string to use when opening the web-app.- Returns:
- The query string to use when opening the web-app.
-
setQuery
public StandAloneWebApp setQuery(String newQuery)
Setter forquery: The query string to use when opening the web-app.- Parameters:
newQuery- The query string to use when opening the web-app.
-
getFinishedPath
public String getFinishedPath()
Getter forfinishedPath: The URI path (excluding leading '/') for the request that terminates the web app. Default is "finished".- Returns:
- The URI path (excluding leading '/') for the request that terminates the web app. Default is "finished".
-
setFinishedPath
@Switch("The URI pathfor the request that terminates the web app. Default is \'finished\'") public StandAloneWebApp setFinishedPath(String newFinishedPath)
Setter forfinishedPath: The URI path (excluding leading '/') for the request that terminates the web app. Default is "finished".- Parameters:
newFinishedPath- The URI path (excluding leading '/') for the request that terminates the web app. Default is "finished".
-
getFinishedResponse
public String getFinishedResponse()
Getter forfinishedResponse: The HTML document to show when /finishedPathis called.- Returns:
- The HTML document to show when /
finishedPathis called.
-
setFinishedResponse
@Switch("The HTML document to show when /finishedPath is called") public StandAloneWebApp setFinishedResponse(String newFinishedResponse)
Setter forfinishedResponse: The HTML document to show when /finishedPathis called.- Parameters:
newFinishedResponse- The HTML document to show when /finishedPathis called.
-
ContentTypeForName
public static String ContentTypeForName(String name)
Determines the content-type for a given resource name, using the file extension.- Parameters:
name-- Returns:
- A valid content-type
-
start
public void start()
Start handling requests
-
-