Top Description Fields Constructors Methods
io.undertow.util

public Class RedirectBuilder

extends Object
Class Inheritance
Imports
io.undertow.server.HttpServerExchange, java.io.UnsupportedEncodingException, java.net.URLEncoder, java.nio.charset.StandardCharsets, java.util.Deque, .Map

Utility class for building redirects.
Author
Stuart Douglas

Field Summary

Modifier and TypeField and Description
public static final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static String
encodeUrlPart(final String part)

perform URL encoding

Todo

this whole thing is kinda crappy.

private static String
realEncode(String part, int startPos)

public static String
redirect(final HttpServerExchange
The HTTP server exchange
exchange
,
final String
The new relative path
newRelativePath
)

Redirects to a new relative path.

public static String
redirect(final HttpServerExchange
The HTTP server exchange
exchange
,
final String
The new relative path
newRelativePath
,
final boolean
If query and path parameters from the exchange should be included
includeParameters
)

Redirects to a new relative path.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

UTF_8back to summary
public static final String UTF_8

Constructor Detail

RedirectBuilderback to summary
private RedirectBuilder()

Method Detail

encodeUrlPartback to summary
private static String encodeUrlPart(final String part) throws UnsupportedEncodingException

perform URL encoding

Todo

this whole thing is kinda crappy.

realEncodeback to summary
private static String realEncode(String part, int startPos) throws UnsupportedEncodingException
redirectback to summary
public static String redirect(final HttpServerExchange exchange, final String newRelativePath)

Redirects to a new relative path. All other data from the exchange is preserved.

Parameters
exchange:HttpServerExchange

The HTTP server exchange

newRelativePath:String

The new relative path

redirectback to summary
public static String redirect(final HttpServerExchange exchange, final String newRelativePath, final boolean includeParameters)

Redirects to a new relative path. All other data from the exchange is preserved.

Parameters
exchange:HttpServerExchange

The HTTP server exchange

newRelativePath:String

The new relative path

includeParameters:boolean

If query and path parameters from the exchange should be included