public final class HttpRequestUriUtils
extends java.lang.Object
/
as path, and no query nor fragment.Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getBaseRequestUri(ConnectionContext ctx,
HttpRequestMetaData metaData,
boolean includeUserInfo)
Get the base URI for the provided
ConnectionContext and HttpRequestMetaData . |
static java.lang.String |
getBaseRequestUri(ConnectionContext ctx,
HttpRequestMetaData metaData,
java.lang.String fixedScheme,
java.lang.String fixedAuthority,
boolean includeUserInfo)
Get the base URI for the provided
ConnectionContext and HttpRequestMetaData . |
static java.lang.String |
getEffectiveRequestUri(ConnectionContext ctx,
HttpRequestMetaData metaData,
boolean includeUserInfo)
Get the effective request URI for the provided
ConnectionContext and HttpRequestMetaData . |
static java.lang.String |
getEffectiveRequestUri(ConnectionContext ctx,
HttpRequestMetaData metaData,
java.lang.String fixedScheme,
java.lang.String fixedAuthority,
boolean includeUserInfo)
Get the effective request URI for the provided
ConnectionContext and HttpRequestMetaData . |
static java.lang.String |
getEffectiveRequestUri(HttpRequestMetaData metaData,
java.lang.String fixedScheme,
java.lang.String fixedAuthority,
boolean includeUserInfo)
Get the effective request URI for the provided
HttpRequestMetaData . |
public static java.lang.String getEffectiveRequestUri(ConnectionContext ctx, HttpRequestMetaData metaData, boolean includeUserInfo)
ConnectionContext
and HttpRequestMetaData
.
For example, for this origin-form request:
GET /pub/WWW/TheProject.html HTTP/1.1 Host: www.example.org:8080the effective request URI will be:
http://www.example.org:8080/pub/WWW/TheProject.html
ctx
- the ConnectionContext
to use.metaData
- the HttpRequestMetaData
to use.includeUserInfo
- true
if the deprecated user info sub-component must be included
(see RFC 7230, section 2.7.1).String
.public static java.lang.String getEffectiveRequestUri(ConnectionContext ctx, HttpRequestMetaData metaData, @Nullable java.lang.String fixedScheme, @Nullable java.lang.String fixedAuthority, boolean includeUserInfo)
ConnectionContext
and HttpRequestMetaData
.
For example, for this origin-form request:
GET /pub/WWW/TheProject.html HTTP/1.1 Host: www.example.org:8080and a
fixedAuthority
of "example.com"
the effective request URI will be:
http://example.com/pub/WWW/TheProject.html
ctx
- the ConnectionContext
to use.metaData
- the HttpRequestMetaData
to use.fixedScheme
- the configured fixed scheme as String
, or null
if none is set.fixedAuthority
- the configured fixed authority as String
, or null
if none is set.includeUserInfo
- true
if the deprecated user info sub-component must be included
(see RFC 7230, section 2.7.1).
Note that this flag has no effect on any user info that could be provided in fixedAuthority
.String
.java.lang.IllegalArgumentException
- if fixedScheme
is not null
and is not
http
nor https
.public static java.lang.String getEffectiveRequestUri(HttpRequestMetaData metaData, java.lang.String fixedScheme, java.lang.String fixedAuthority, boolean includeUserInfo)
HttpRequestMetaData
.
For example, for this origin-form request:
GET /pub/WWW/TheProject.html HTTP/1.1 Host: www.example.org:8080and a
fixedAuthority
of "example.com"
the effective request URI will be:
http://example.com/pub/WWW/TheProject.html
metaData
- the HttpRequestMetaData
to use.fixedScheme
- the configured fixed scheme as String
, or null
if none is set.fixedAuthority
- the configured fixed authority as String
, or null
if none is set.includeUserInfo
- true
if the deprecated user info sub-component must be included
(see RFC 7230, section 2.7.1).
Note that this flag has no effect on any user info that could be provided in fixedAuthority
.String
.java.lang.IllegalArgumentException
- if fixedScheme
is not null
and is not
http
nor https
.public static java.lang.String getBaseRequestUri(ConnectionContext ctx, HttpRequestMetaData metaData, boolean includeUserInfo)
ConnectionContext
and HttpRequestMetaData
.
For example, for this origin-form request:
GET /pub/WWW/TheProject.html HTTP/1.1 Host: www.example.org:8080the base request URI will be:
http://www.example.org:8080/
ctx
- the ConnectionContext
to use.metaData
- the HttpRequestMetaData
to use.includeUserInfo
- true
if the deprecated user info sub-component must be included
(see RFC 7230, section 2.7.1).String
.public static java.lang.String getBaseRequestUri(ConnectionContext ctx, HttpRequestMetaData metaData, @Nullable java.lang.String fixedScheme, @Nullable java.lang.String fixedAuthority, boolean includeUserInfo)
ConnectionContext
and HttpRequestMetaData
.
For example, for this origin-form request:
GET /pub/WWW/TheProject.html HTTP/1.1 Host: www.example.org:8080and a
fixedAuthority
of "example.com"
the base request URI will be:
http://example.com/
ctx
- the ConnectionContext
to use.metaData
- the HttpRequestMetaData
to use.fixedScheme
- the configured fixed scheme as String
, or null
if none is set.fixedAuthority
- the configured fixed authority as String
, or null
if none is set.includeUserInfo
- true
if the deprecated user info sub-component must be included
(see RFC 7230, section 2.7.1).
Note that this flag has no effect on any user info that could be provided in fixedAuthority
.String
.java.lang.IllegalArgumentException
- if fixedScheme
is not null
and is not
http
nor https
.