Top Description Inners Fields Constructors Methods
io.undertow.server.handlers

public Class URLDecodingHandler

extends Object
implements HttpHandler
Class Inheritance
All Implemented Interfaces
io.undertow.server.HttpHandler
Imports
java.util.ArrayDeque, .Collections, .Deque, .Map, .Set, .TreeMap, io.undertow.UndertowOptions, io.undertow.server.HandlerWrapper, .HttpHandler, .HttpServerExchange, io.undertow.server.handlers.builder.HandlerBuilder, io.undertow.util.AttachmentKey, .PathTemplateMatch, .URLUtils

A handler that will decode the URL and query parameters to the specified charset.

This handler will not have any effect unless the io.undertow.UndertowOptions#DECODE_URL parameter is set to false.

This is not as efficient as using the parsers built in UTF-8 decoder. Unless you need to decode to something other than UTF-8 you should rely on the parsers decoding instead.

Author
Stuart Douglas

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
private static class

Field Summary

Modifier and TypeField and Description
private static final AttachmentKey<Object>
private final String
private static final ThreadLocal<StringBuilder>
private final HttpHandler

Constructor Summary

AccessConstructor and Description
public
URLDecodingHandler(final HttpHandler next, final String charset)

Method Summary

Modifier and TypeMethod and Description
private static void
private static void
private static void
private static StringBuilder
public void
handleRequest(final HttpServerExchange
the HTTP request/response exchange
exchange
)

Implements io.undertow.server.HttpHandler.handleRequest.

Handle the request.

private static boolean
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

ALREADY_DECODEDback to summary
private static final AttachmentKey<Object> ALREADY_DECODED
charsetback to summary
private final String charset
DECODING_BUFFER_CACHEback to summary
private static final ThreadLocal<StringBuilder> DECODING_BUFFER_CACHE
nextback to summary
private final HttpHandler next

Constructor Detail

URLDecodingHandlerback to summary
public URLDecodingHandler(final HttpHandler next, final String charset)

Method Detail

decodePathback to summary
private static void decodePath(HttpServerExchange exchange, String charset, StringBuilder sb)
decodePathTemplateMatchback to summary
private static void decodePathTemplateMatch(HttpServerExchange exchange, String charset, StringBuilder sb)
decodeQueryStringback to summary
private static void decodeQueryString(HttpServerExchange exchange, String charset, StringBuilder sb)
getStringBuilderForDecodingback to summary
private static StringBuilder getStringBuilderForDecoding(HttpServerExchange exchange)
handleRequestback to summary
public void handleRequest(final HttpServerExchange exchange) throws Exception

Implements io.undertow.server.HttpHandler.handleRequest.

Doc from io.undertow.server.HttpHandler.handleRequest.

Handle the request.

Parameters
exchange:HttpServerExchange

the HTTP request/response exchange

Annotations
@Override
shouldDecodeback to summary
private static boolean shouldDecode(final HttpServerExchange exchange)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
io.undertow.server.handlers back to summary

public Class URLDecodingHandler.Builder

extends Object
implements HandlerBuilder
Class Inheritance
All Implemented Interfaces
io.undertow.server.handlers.builder.HandlerBuilder

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public HandlerWrapper
build(Map<String, Object>
The handler config
config
)

Implements io.undertow.server.handlers.builder.HandlerBuilder.build.

Creates the handler

public String
public String
name()

Implements io.undertow.server.handlers.builder.HandlerBuilder.name.

The string representation of the handler name.

public Map<String, Class<?>>
parameters()

Implements io.undertow.server.handlers.builder.HandlerBuilder.parameters.

Returns a map of parameters and their types.

public Set<String>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Builderback to summary
public Builder()

Method Detail

buildback to summary
public HandlerWrapper build(Map<String, Object> config)

Implements io.undertow.server.handlers.builder.HandlerBuilder.build.

Doc from io.undertow.server.handlers.builder.HandlerBuilder.build.

Creates the handler

Parameters
config:Map<String, Object>

The handler config

Returns:HandlerWrapper

The new predicate

Annotations
@Override
defaultParameterback to summary
public String defaultParameter()

Implements io.undertow.server.handlers.builder.HandlerBuilder.defaultParameter.

Returns:String

Doc from io.undertow.server.handlers.builder.HandlerBuilder.defaultParameter.

The default parameter name, or null if it does not have a default parameter

Annotations
@Override
nameback to summary
public String name()

Implements io.undertow.server.handlers.builder.HandlerBuilder.name.

Doc from io.undertow.server.handlers.builder.HandlerBuilder.name.

The string representation of the handler name.

Returns:String

The handler name

Annotations
@Override
parametersback to summary
public Map<String, Class<?>> parameters()

Implements io.undertow.server.handlers.builder.HandlerBuilder.parameters.

Doc from io.undertow.server.handlers.builder.HandlerBuilder.parameters.

Returns a map of parameters and their types.

Annotations
@Override
requiredParametersback to summary
public Set<String> requiredParameters()

Implements io.undertow.server.handlers.builder.HandlerBuilder.requiredParameters.

Returns:Set<String>

Doc from io.undertow.server.handlers.builder.HandlerBuilder.requiredParameters.

The required parameters

Annotations
@Override
io.undertow.server.handlers back to summary

private Class URLDecodingHandler.Wrapper

extends Object
implements HandlerWrapper
Class Inheritance
All Implemented Interfaces
io.undertow.server.HandlerWrapper

Field Summary

Modifier and TypeField and Description
private final String

Constructor Summary

AccessConstructor and Description
private
Wrapper(String charset)

Method Summary

Modifier and TypeMethod and Description
public HttpHandler
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

charsetback to summary
private final String charset

Constructor Detail

Wrapperback to summary
private Wrapper(String charset)

Method Detail

wrapback to summary
public HttpHandler wrap(HttpHandler handler)

Implements io.undertow.server.HandlerWrapper.wrap.

Annotations
@Override