public class Httpd extends java.lang.Object implements RunnableWhichThrows<java.io.IOException>, Stoppable
| Constructor and Description |
|---|
Httpd(java.net.InetSocketAddress endpoint,
javax.net.ssl.SSLContext sslContext,
java.lang.String documentRootDirectoryNamePattern)
Accepts secure (HTTPS) connections on the endpoint; responds each received request with the contents
of the file designated by the documentRootDirectoryNamePattern/path, where the placeholder
"
{path}" is substituted with the "path" component of the requested URI. |
Httpd(java.net.InetSocketAddress endpoint,
java.lang.String documentRootDirectoryNamePattern)
Accepts connections on the endpoint; responds each received request with the contents of the file
designated by the documentRootDirectoryNamePattern/path, where the placeholder
"
{path}" is substituted with the "path" component of the requested URI. |
| Modifier and Type | Method and Description |
|---|---|
java.net.InetSocketAddress |
getEndpointAddress()
The address and the actual port that this
Httpd is bound to. |
void |
run()
"To run" an instance means to call this method and wait until it returns.
|
void |
stop()
Will stop the accepting connections from the server socket, close the server socket, and cause
run() to
return as quickly as possible. |
public Httpd(java.net.InetSocketAddress endpoint,
java.lang.String documentRootDirectoryNamePattern)
throws java.io.IOException
{path}" is substituted with the "path" component of the requested URI.java.io.IOExceptionpublic Httpd(java.net.InetSocketAddress endpoint,
javax.net.ssl.SSLContext sslContext,
java.lang.String documentRootDirectoryNamePattern)
throws java.io.IOException
{path}" is substituted with the "path" component of the requested URI.java.io.IOExceptionpublic void run()
throws java.io.IOException
RunnableWhichThrowsrun in interface RunnableWhichThrows<java.io.IOException>java.io.IOExceptionpublic void stop()
run() to
return as quickly as possible.public java.net.InetSocketAddress getEndpointAddress()
Httpd is bound to.