Java HTTP Server
A B C D E F G H I K P R S T V

A

add(String, String) - Method in class com.sun.net.httpserver.Headers
adds the given value to the list of headers for the given key.
authenticate(HttpExchange) - Method in class com.sun.net.httpserver.Authenticator
called to authenticate each incoming request.
authenticate(HttpExchange) - Method in class com.sun.net.httpserver.BasicAuthenticator
 
Authenticator - Class in com.sun.net.httpserver
Authenticator represents an implementation of an HTTP authentication mechanism.
Authenticator() - Constructor for class com.sun.net.httpserver.Authenticator
 
Authenticator.Failure - Class in com.sun.net.httpserver
Indicates an authentication failure.
Authenticator.Failure(int) - Constructor for class com.sun.net.httpserver.Authenticator.Failure
 
Authenticator.Result - Class in com.sun.net.httpserver
Base class for return type from authenticate() method
Authenticator.Result() - Constructor for class com.sun.net.httpserver.Authenticator.Result
 
Authenticator.Retry - Class in com.sun.net.httpserver
Indicates an authentication must be retried.
Authenticator.Retry(int) - Constructor for class com.sun.net.httpserver.Authenticator.Retry
 
Authenticator.Success - Class in com.sun.net.httpserver
Indicates an authentication has succeeded and the authenticated user principal can be acquired by calling getPrincipal().
Authenticator.Success(HttpPrincipal) - Constructor for class com.sun.net.httpserver.Authenticator.Success
 

B

BasicAuthenticator - Class in com.sun.net.httpserver
BasicAuthenticator provides an implementation of HTTP Basic authentication.
BasicAuthenticator(String) - Constructor for class com.sun.net.httpserver.BasicAuthenticator
Creates a BasicAuthenticator for the given HTTP realm
bind(InetSocketAddress, int) - Method in class com.sun.net.httpserver.HttpServer
Binds a currently unbound HttpServer to the given address and port number.

C

checkCredentials(String, String) - Method in class com.sun.net.httpserver.BasicAuthenticator
called for each incoming request to verify the given name and password in the context of this Authenticator's realm.
clear() - Method in class com.sun.net.httpserver.Headers
 
close() - Method in class com.sun.net.httpserver.HttpExchange
Ends this exchange by doing the following in sequence:
com.sun.net.httpserver - package com.sun.net.httpserver
Provides a simple high-level Http server API, which can be used to build embedded HTTP servers.
com.sun.net.httpserver.spi - package com.sun.net.httpserver.spi
Provides a pluggable service provider interface, which allows the HTTP server implementation to be replaced with other implementations.
configure(HttpsParameters) - Method in class com.sun.net.httpserver.HttpsConfigurator
Called by the HttpsServer to configure the parameters for a https connection currently being established.
containsKey(Object) - Method in class com.sun.net.httpserver.Headers
 
containsValue(Object) - Method in class com.sun.net.httpserver.Headers
 
create() - Static method in class com.sun.net.httpserver.HttpServer
creates a HttpServer instance which is initially not bound to any local address/port.
create(InetSocketAddress, int) - Static method in class com.sun.net.httpserver.HttpServer
Create a HttpServer instance which will bind to the specified InetSocketAddress (IP address and port number) A maximum backlog can also be specified.
create() - Static method in class com.sun.net.httpserver.HttpsServer
creates a HttpsServer instance which is initially not bound to any local address/port.
create(InetSocketAddress, int) - Static method in class com.sun.net.httpserver.HttpsServer
Create a HttpsServer instance which will bind to the specified InetSocketAddress (IP address and port number) A maximum backlog can also be specified.
createContext(String, HttpHandler) - Method in class com.sun.net.httpserver.HttpServer
Creates a HttpContext.
createContext(String) - Method in class com.sun.net.httpserver.HttpServer
Creates a HttpContext without initially specifying a handler.
createHttpServer(InetSocketAddress, int) - Method in class com.sun.net.httpserver.spi.HttpServerProvider
creates a HttpServer from this provider
createHttpsServer(InetSocketAddress, int) - Method in class com.sun.net.httpserver.spi.HttpServerProvider
creates a HttpsServer from this provider

D

description() - Method in class com.sun.net.httpserver.Filter
returns a short description of this Filter
doFilter(HttpExchange) - Method in class com.sun.net.httpserver.Filter.Chain
calls the next filter in the chain, or else the users exchange handler, if this is the final filter in the chain.
doFilter(HttpExchange, Filter.Chain) - Method in class com.sun.net.httpserver.Filter
Asks this filter to pre/post-process the given exchange.

E

entrySet() - Method in class com.sun.net.httpserver.Headers
 
equals(Object) - Method in class com.sun.net.httpserver.Headers
 
equals(Object) - Method in class com.sun.net.httpserver.HttpPrincipal
Compares two HttpPrincipal.

F

Filter - Class in com.sun.net.httpserver
A filter used to pre- and post-process incoming requests.
Filter() - Constructor for class com.sun.net.httpserver.Filter
 
Filter.Chain - Class in com.sun.net.httpserver
a chain of filters associated with a HttpServer.
Filter.Chain(List<Filter>, HttpHandler) - Constructor for class com.sun.net.httpserver.Filter.Chain
 

G

get(Object) - Method in class com.sun.net.httpserver.Headers
 
getAddress() - Method in class com.sun.net.httpserver.HttpServer
returns the address this server is listening on
getAttribute(String) - Method in class com.sun.net.httpserver.HttpExchange
Filter modules may store arbitrary objects with HttpExchange instances as an out-of-band communication mechanism.
getAttributes() - Method in class com.sun.net.httpserver.HttpContext
returns a mutable Map, which can be used to pass configuration and other data to Filter modules and to the context's exchange handler.
getAuthenticator() - Method in class com.sun.net.httpserver.HttpContext
Returns the currently set Authenticator for this context if one exists.
getCipherSuites() - Method in class com.sun.net.httpserver.HttpsParameters
Returns a copy of the array of ciphersuites or null if none have been set.
getClientAddress() - Method in class com.sun.net.httpserver.HttpsParameters
Returns the address of the remote client initiating the connection.
getExecutor() - Method in class com.sun.net.httpserver.HttpServer
returns this server's Executor object if one was specified with HttpServer.setExecutor(Executor), or null if none was specified.
getFilters() - Method in class com.sun.net.httpserver.HttpContext
returns this context's list of Filters.
getFirst(String) - Method in class com.sun.net.httpserver.Headers
returns the first value from the List of String values for the given key (if at least one exists).
getHandler() - Method in class com.sun.net.httpserver.HttpContext
returns the handler for this context
getHttpContext() - Method in class com.sun.net.httpserver.HttpExchange
Get the HttpContext for this exchange
getHttpsConfigurator() - Method in class com.sun.net.httpserver.HttpsParameters
Returns the HttpsConfigurator for this HttpsParameters.
getHttpsConfigurator() - Method in class com.sun.net.httpserver.HttpsServer
Gets this server's HttpsConfigurator object, if it has been set.
getLocalAddress() - Method in class com.sun.net.httpserver.HttpExchange
Returns the local address on which the request was received
getName() - Method in class com.sun.net.httpserver.HttpPrincipal
returns the contents of this principal in the form realm:username
getNeedClientAuth() - Method in class com.sun.net.httpserver.HttpsParameters
Returns whether client authentication should be required.
getPath() - Method in class com.sun.net.httpserver.HttpContext
returns the path this context was created with
getPrincipal() - Method in class com.sun.net.httpserver.Authenticator.Success
returns the authenticated user Principal
getPrincipal() - Method in class com.sun.net.httpserver.HttpExchange
If an authenticator is set on the HttpContext that owns this exchange, then this method will return the HttpPrincipal that represents the authenticated user for this HttpExchange.
getProtocol() - Method in class com.sun.net.httpserver.HttpExchange
Returns the protocol string from the request in the form protocol/majorVersion.minorVersion.
getProtocols() - Method in class com.sun.net.httpserver.HttpsParameters
Returns a copy of the array of protocols or null if none have been set.
getRealm() - Method in class com.sun.net.httpserver.BasicAuthenticator
returns the realm this BasicAuthenticator was created with
getRealm() - Method in class com.sun.net.httpserver.HttpPrincipal
returns the realm this object was created with.
getRemoteAddress() - Method in class com.sun.net.httpserver.HttpExchange
Returns the address of the remote entity invoking this request
getRequestBody() - Method in class com.sun.net.httpserver.HttpExchange
returns a stream from which the request body can be read.
getRequestHeaders() - Method in class com.sun.net.httpserver.HttpExchange
Returns an immutable Map containing the HTTP headers that were included with this request.
getRequestMethod() - Method in class com.sun.net.httpserver.HttpExchange
Get the request method
getRequestURI() - Method in class com.sun.net.httpserver.HttpExchange
Get the request URI
getResponseBody() - Method in class com.sun.net.httpserver.HttpExchange
returns a stream to which the response body must be written.
getResponseCode() - Method in class com.sun.net.httpserver.Authenticator.Failure
returns the response code to send to the client
getResponseCode() - Method in class com.sun.net.httpserver.Authenticator.Retry
returns the response code to send to the client
getResponseCode() - Method in class com.sun.net.httpserver.HttpExchange
Returns the response code, if it has already been set
getResponseHeaders() - Method in class com.sun.net.httpserver.HttpExchange
Returns a mutable Map into which the HTTP response headers can be stored and which will be transmitted as part of this response.
getServer() - Method in class com.sun.net.httpserver.HttpContext
returns the server this context was created with
getSSLContext() - Method in class com.sun.net.httpserver.HttpsConfigurator
Returns the SSLContext for this HttpsConfigurator.
getSSLSession() - Method in class com.sun.net.httpserver.HttpsExchange
Get the SSLSession for this exchange.
getUsername() - Method in class com.sun.net.httpserver.HttpPrincipal
returns the username this object was created with.
getWantClientAuth() - Method in class com.sun.net.httpserver.HttpsParameters
Returns whether client authentication should be requested.

H

handle(HttpExchange) - Method in interface com.sun.net.httpserver.HttpHandler
Handle the given request and generate an appropriate response.
hashCode() - Method in class com.sun.net.httpserver.Headers
 
hashCode() - Method in class com.sun.net.httpserver.HttpPrincipal
returns a hashcode for this HttpPrincipal.
Headers - Class in com.sun.net.httpserver
HTTP request and response headers are represented by this class which implements the interface Map< String,List<String>>.
Headers() - Constructor for class com.sun.net.httpserver.Headers
 
HttpContext - Class in com.sun.net.httpserver
HttpContext represents a mapping between the root URI path of an application to a HttpHandler which is invoked to handle requests destined for that path on the associated HttpServer or HttpsServer.
HttpContext() - Constructor for class com.sun.net.httpserver.HttpContext
 
HttpExchange - Class in com.sun.net.httpserver
This class encapsulates a HTTP request received and a response to be generated in one exchange.
HttpExchange() - Constructor for class com.sun.net.httpserver.HttpExchange
 
HttpHandler - Interface in com.sun.net.httpserver
A handler which is invoked to process HTTP exchanges.
HttpPrincipal - Class in com.sun.net.httpserver
Represents a user authenticated by HTTP Basic or Digest authentication.
HttpPrincipal(String, String) - Constructor for class com.sun.net.httpserver.HttpPrincipal
creates a HttpPrincipal from the given username and realm
HttpsConfigurator - Class in com.sun.net.httpserver
This class is used to configure the https parameters for each incoming https connection on a HttpsServer.
HttpsConfigurator(SSLContext) - Constructor for class com.sun.net.httpserver.HttpsConfigurator
Creates an Https configuration, with the given SSLContext.
HttpServer - Class in com.sun.net.httpserver
This class implements a simple HTTP server.
HttpServer() - Constructor for class com.sun.net.httpserver.HttpServer
 
HttpServerProvider - Class in com.sun.net.httpserver.spi
Service provider class for HttpServer.
HttpServerProvider() - Constructor for class com.sun.net.httpserver.spi.HttpServerProvider
Initializes a new instance of this class.
HttpsExchange - Class in com.sun.net.httpserver
This class encapsulates a HTTPS request received and a response to be generated in one exchange and defines the extensions to HttpExchange that are specific to the HTTPS protocol.
HttpsExchange() - Constructor for class com.sun.net.httpserver.HttpsExchange
 
HttpsParameters - Class in com.sun.net.httpserver
Represents the set of parameters for each https connection negotiated with clients.
HttpsParameters() - Constructor for class com.sun.net.httpserver.HttpsParameters
 
HttpsServer - Class in com.sun.net.httpserver
This class is an extension of HttpServer which provides support for HTTPS.
HttpsServer() - Constructor for class com.sun.net.httpserver.HttpsServer
 

I

isEmpty() - Method in class com.sun.net.httpserver.Headers
 

K

keySet() - Method in class com.sun.net.httpserver.Headers
 

P

provider() - Static method in class com.sun.net.httpserver.spi.HttpServerProvider
Returns the system wide default HttpServerProvider for this invocation of the Java virtual machine.
put(String, List<String>) - Method in class com.sun.net.httpserver.Headers
 
putAll(Map<? extends String, ? extends List<String>>) - Method in class com.sun.net.httpserver.Headers
 

R

realm - Variable in class com.sun.net.httpserver.BasicAuthenticator
 
remove(Object) - Method in class com.sun.net.httpserver.Headers
 
removeContext(String) - Method in class com.sun.net.httpserver.HttpServer
Removes the context identified by the given path from the server.
removeContext(HttpContext) - Method in class com.sun.net.httpserver.HttpServer
Removes the given context from the server.

S

sendResponseHeaders(int, long) - Method in class com.sun.net.httpserver.HttpExchange
Starts sending the response back to the client using the current set of response headers and the numeric response code as specified in this method.
set(String, String) - Method in class com.sun.net.httpserver.Headers
sets the given value as the sole header value for the given key.
setAttribute(String, Object) - Method in class com.sun.net.httpserver.HttpExchange
Filter modules may store arbitrary objects with HttpExchange instances as an out-of-band communication mechanism.
setAuthenticator(Authenticator) - Method in class com.sun.net.httpserver.HttpContext
Sets the Authenticator for this HttpContext.
setCipherSuites(String[]) - Method in class com.sun.net.httpserver.HttpsParameters
Sets the array of ciphersuites.
setExecutor(Executor) - Method in class com.sun.net.httpserver.HttpServer
sets this server's Executor object.
setHandler(HttpHandler) - Method in class com.sun.net.httpserver.HttpContext
Sets the handler for this context, if not already set.
setHttpsConfigurator(HttpsConfigurator) - Method in class com.sun.net.httpserver.HttpsServer
Sets this server's HttpsConfigurator object.
setNeedClientAuth(boolean) - Method in class com.sun.net.httpserver.HttpsParameters
Sets whether client authentication should be required.
setProtocols(String[]) - Method in class com.sun.net.httpserver.HttpsParameters
Sets the array of protocols.
setSSLParameters(SSLParameters) - Method in class com.sun.net.httpserver.HttpsParameters
Sets the SSLParameters to use for this HttpsParameters.
setStreams(InputStream, OutputStream) - Method in class com.sun.net.httpserver.HttpExchange
Used by Filters to wrap either (or both) of this exchange's InputStream and OutputStream, with the given filtered streams so that subsequent calls to HttpExchange.getRequestBody() will return the given InputStream, and calls to HttpExchange.getResponseBody() will return the given OutputStream.
setWantClientAuth(boolean) - Method in class com.sun.net.httpserver.HttpsParameters
Sets whether client authentication should be requested.
size() - Method in class com.sun.net.httpserver.Headers
 
start() - Method in class com.sun.net.httpserver.HttpServer
Starts this server in a new background thread.
stop(int) - Method in class com.sun.net.httpserver.HttpServer
stops this server by closing the listening socket and disallowing any new exchanges from being processed.

T

toString() - Method in class com.sun.net.httpserver.HttpPrincipal
returns the same string as getName()

V

values() - Method in class com.sun.net.httpserver.Headers
 

A B C D E F G H I K P R S T V
Java HTTP Server

Copyright © 2005, 2011, Oracle and/or its affiliates. All rights reserved.

Scripting on this page tracks web page traffic, but does not change the content in any way.