Package httpserver.handlers
Enum Class Common
- All Implemented Interfaces:
Serializable,Comparable<Common>,Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckEtag(String etag, HttpServerExchange exchange, HttpHandler next) static HttpHandlerstatic HttpHandlerstatic booleanmatchesEtag(HttpServerExchange request, String etag) static HttpHandlerstatic HttpHandlerpathPrefix(String prefix, HttpHandler ifTrue, HttpHandler ifFalse) static HttpHandlerstatic HttpHandlerresourceHandler(String wwwroot, HttpHandler fallback) static HttpHandlersecurityHeaders(boolean isSecure, HttpHandler next) static HttpHandlersinglePageApp(String pageContent, Set<String> pageURIs) static HttpHandlerstaticHtml(String content) static HttpHandlerstatusCode(int code) static CommonReturns the enum constant of this class with the specified name.static Common[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
logError
public static HttpHandler logError(Consumer<Exception> onException, Consumer<Error> onError, HttpHandler next) -
pathPrefix
-
staticHtml
-
matchesEtag
-
checkEtag
public static void checkEtag(String etag, HttpServerExchange exchange, HttpHandler next) throws Exception - Throws:
Exception
-
html404
-
statusCode
-
redirect
-
noSuchApiEndpoint
-
securityHeaders
-
singlePageApp
-
resourceHandler
-