public abstract class AbstractHTTPD extends NanoHTTPD implements HTTPGetHandler
NanoHTTPD to (a) prevent serving files from
the local file system; and (b) to expose methods for handling GET, PUT, POST,
and DELETE requests - these methods all return a
NanoHTTPD.HTTP_METHOD_NOT_ALLOWED NanoHTTPD.Response by default.NanoHTTPD.Request, NanoHTTPD.ResponseIServiceShutdown.OptionsCONTENT_LENGTH, CONTENT_TYPE, DATE, DELETE, ERR_BAD_REQUEST, GET, HTTP_BADREQUEST, HTTP_FORBIDDEN, HTTP_INTERNALERROR, HTTP_METHOD_NOT_ALLOWED, HTTP_NOTFOUND, HTTP_NOTIMPLEMENTED, HTTP_OK, HTTP_REDIRECT, httpDefaultCharacterEncoding, MIME_APPLICATION_URL_ENCODED, MIME_APPLICATION_XML, MIME_DEFAULT_BINARY, MIME_TEXT_HTML, MIME_TEXT_JAVASCRIPT, MIME_TEXT_PLAIN, POST, PUT, UTF8| Constructor and Description |
|---|
AbstractHTTPD(int port) |
| Modifier and Type | Method and Description |
|---|---|
NanoHTTPD.Response |
doDelete(NanoHTTPD.Request req)
Handle a DELETE request.
|
NanoHTTPD.Response |
doGet(NanoHTTPD.Request req)
Handle a GET request.
|
NanoHTTPD.Response |
doPost(NanoHTTPD.Request req)
Handle a POST request.
|
NanoHTTPD.Response |
doPut(NanoHTTPD.Request req)
Handle a PUT request.
|
NanoHTTPD.Response |
serve(NanoHTTPD.Request req)
Override this to customize the server.
|
decodeParams, encodeParams, getPort, isOpen, main, serveFile, shutdown, shutdownNowpublic AbstractHTTPD(int port)
throws IOException
IOExceptionpublic NanoHTTPD.Response serve(NanoHTTPD.Request req)
NanoHTTPDpublic NanoHTTPD.Response doGet(NanoHTTPD.Request req) throws Exception
doGet in interface HTTPGetHandlerreq - The requestExceptionNanoHTTPD.Responsepublic NanoHTTPD.Response doPost(NanoHTTPD.Request req) throws Exception
req - The requestExceptionpublic NanoHTTPD.Response doPut(NanoHTTPD.Request req) throws Exception
req - The requestExceptionpublic NanoHTTPD.Response doDelete(NanoHTTPD.Request req) throws Exception
req - The requestExceptionCopyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.