public class Httpd extends Object implements de.unkrig.commons.lang.protocol.RunnableWhichThrows<IOException>, de.unkrig.commons.lang.protocol.Stoppable
Constructor and Description |
---|
Httpd(InetSocketAddress endpoint,
SSLContext sslContext,
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(InetSocketAddress endpoint,
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 |
---|---|
InetSocketAddress |
getEndpointAddress()
The address and the actual port that this
Httpd is bound to. |
void |
run() |
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(InetSocketAddress endpoint, String documentRootDirectoryNamePattern) throws IOException
{path}
" is substituted with the "path" component of the requested URI.IOException
public Httpd(InetSocketAddress endpoint, SSLContext sslContext, String documentRootDirectoryNamePattern) throws IOException
{path}
" is substituted with the "path" component of the requested URI.IOException
public void run() throws IOException
run
in interface de.unkrig.commons.lang.protocol.RunnableWhichThrows<IOException>
IOException
public void stop()
run()
to
return as quickly as possible.stop
in interface de.unkrig.commons.lang.protocol.Stoppable
public InetSocketAddress getEndpointAddress()
Httpd
is bound to.Copyright © 2018 Arno Unkrig. All rights reserved.