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 String
ContentTypeForName(String name)
Determines the content-type for a given resource name, using the file extension.String
getFinishedPath()
Getter forfinishedPath
: The URI path (excluding leading '/') for the request that terminates the web app.String
getFinishedResponse()
Getter forfinishedResponse
: The HTML document to show when /finishedPath
is called.Integer
getPort()
Getter forport
: Server port to listen on.String
getQuery()
Getter forquery
: The query string to use when opening the web-app.File
getRoot()
Getter forroot
: Root directory of webapp.static void
main(String[] argv)
Command-line entrypointStandAloneWebApp
setFinishedPath(String newFinishedPath)
Setter forfinishedPath
: The URI path (excluding leading '/') for the request that terminates the web app.StandAloneWebApp
setFinishedResponse(String newFinishedResponse)
Setter forfinishedResponse
: The HTML document to show when /finishedPath
is called.StandAloneWebApp
setPort(Integer newPort)
Setter forport
: Server port to listen on.StandAloneWebApp
setQuery(String newQuery)
Setter forquery
: The query string to use when opening the web-app.StandAloneWebApp
setRoot(File newRoot)
Setter forroot
: Root directory of webapp.void
start()
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 /finishedPath
is called.- Returns:
- The HTML document to show when /
finishedPath
is 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 /finishedPath
is called.- Parameters:
newFinishedResponse
- The HTML document to show when /finishedPath
is 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
-
-