Package de.uplanet.lucy.server.composer
Class UrlBuilder
java.lang.Object
de.uplanet.lucy.server.composer.UrlBuilder
-
Method Summary
Modifier and TypeMethodDescriptionstatic URL
createAbsoluteBaseDirectoryUrl
(de.uplanet.lucy.server.connector.IRequestProcessingContext p_ctx) Deprecated.static URL
Deprecated.UsecreateAbsoluteBaseUrl(IServerBridgeRequest)
instead.static URL
createAbsoluteBaseUrl
(de.uplanet.lucy.server.connector.IRequestProcessingContext p_ctx) static URL
createAbsoluteBaseUrl
(IServerBridgeRequest p_request) Create an absolute base URL from the given request.static URL
createAbsoluteRequestBaseDirectoryUrl
(de.uplanet.lucy.server.connector.IRequestProcessingContext p_ctx) Reconstructs the URL the client used to make the request.static URL
Reconstructs the URL the client used to make the request.static URL
createBaseUrl
(de.uplanet.lucy.server.connector.IRequestProcessingContext p_ctx) Create a base URL, i.e.static URL
createBaseUrl
(IServerBridgeRequest p_request) Create a base URL, i.e.static URL
createDefaultUrl
(de.uplanet.lucy.server.connector.IRequestProcessingContext p_ctx) Deprecated.UsecreateBaseUrl(IRequestProcessingContext)
instead.static URL
createDefaultUrl
(IServerBridgeRequest p_request) Deprecated.UsecreateBaseUrl(IServerBridgeRequest)
instead.static URL
createRequestBaseDirectoryUrl
(de.uplanet.lucy.server.connector.IRequestProcessingContext p_ctx) Deprecated.static URL
Deprecated.static URL
createWebSocketBaseUrl
(de.uplanet.lucy.server.connector.IRequestProcessingContext p_ctx) static URL
createWebSocketBaseUrl
(IServerBridgeRequest p_request) Create a WebSocket URL from the given request.static URL
Create an URL from the given string.
-
Method Details
-
createBaseUrl
Create a base URL, i.e. a relative URL containing solely the root path/
.- Parameters:
p_request
- The request.- Returns:
- The
/
base URL.
-
createBaseUrl
Create a base URL, i.e. a relative URL containing solely the root path/
.- Parameters:
p_ctx
- The processing context.- Returns:
- The
/
base URL. - See Also:
-
createAbsoluteBaseUrl
public static URL createAbsoluteBaseUrl(de.uplanet.lucy.server.connector.IRequestProcessingContext p_ctx) throws MalformedURLException - Parameters:
p_ctx
- The processing context.- Throws:
MalformedURLException
- See Also:
-
createAbsoluteBaseUrl
public static URL createAbsoluteBaseUrl(IServerBridgeRequest p_request) throws MalformedURLException Create an absolute base URL from the given request.The returned absolute URL will always contain a terminating slash
/
.This method tries to create an absolute base URL as follows
- First, if the
doc("internal/cfg/portal.cfg")/portal/uris/uri[@name='web.url.base.default']
configuration parameter exists, return it. This is the preferred way. The following is a fallback in case the portal's default URL is not configured. - Second, try to create an absolute URL from
SERVERVAR.SCHEME
,SERVERVAR.SERVER_NAME
,SERVERVAR.SERVER_PORT
, and return it.
- Parameters:
p_request
- The request.- Returns:
- The base URL.
- Throws:
MalformedURLException
- If a parsing error occurred.
- First, if the
-
createWebSocketBaseUrl
public static URL createWebSocketBaseUrl(de.uplanet.lucy.server.connector.IRequestProcessingContext p_ctx) throws MalformedURLException - Parameters:
p_ctx
- The processing context.- Throws:
MalformedURLException
- See Also:
-
createWebSocketBaseUrl
public static URL createWebSocketBaseUrl(IServerBridgeRequest p_request) throws MalformedURLException Create a WebSocket URL from the given request.This method uses the same algorithm as
createAbsoluteBaseUrl(IServerBridgeRequest)
except that the scheme isws
orwss
instead ofhttp
orhttps
.- Parameters:
p_request
- The request.- Returns:
- The WebSocket URL.
- Throws:
MalformedURLException
- If a parsing error occurred.- See Also:
-
createAbsoluteRequestBaseDirectoryUrl
public static URL createAbsoluteRequestBaseDirectoryUrl(de.uplanet.lucy.server.connector.IRequestProcessingContext p_ctx) throws MalformedURLException Reconstructs the URL the client used to make the request. The returned URL contains a protocol, server name, (optional) port number, and server path without the document part.The document part is the rightmost path component that is not followed by a slash.
- Parameters:
p_ctx
- The processing context.- Returns:
- The request base directory URL.
- Throws:
MalformedURLException
- If a parsing error occurred.- See Also:
-
createAbsoluteRequestBaseDirectoryUrl
public static URL createAbsoluteRequestBaseDirectoryUrl(IServerBridgeRequest p_request) throws MalformedURLException Reconstructs the URL the client used to make the request. The returned URL contains a protocol, server name, (optional) port number, and server path without the document part.The document part is the rightmost path component that is not followed by a slash.
- Parameters:
p_request
- The request.- Returns:
- The request base directory URL.
- Throws:
MalformedURLException
- If a parsing error occurred.
-
parseUrl
Create an URL from the given string.- Parameters:
p_strUrl
- The string to be parsed.- Returns:
- The URL.
- Throws:
MalformedURLException
- If a parsing error occurred.
-
createDefaultUrl
Deprecated.UsecreateBaseUrl(IServerBridgeRequest)
instead.The same ascreateBaseUrl(IServerBridgeRequest)
.- Parameters:
p_request
- The request.- Returns:
- The URL.
-
createDefaultUrl
@Deprecated public static URL createDefaultUrl(de.uplanet.lucy.server.connector.IRequestProcessingContext p_ctx) Deprecated.UsecreateBaseUrl(IRequestProcessingContext)
instead.The same ascreateBaseUrl(IRequestProcessingContext)
.- Parameters:
p_ctx
- The processing context.- Returns:
- The URL.
-
createAbsoluteBaseDirectoryUrl
@Deprecated public static URL createAbsoluteBaseDirectoryUrl(IServerBridgeRequest p_request) throws MalformedURLException Deprecated.UsecreateAbsoluteBaseUrl(IServerBridgeRequest)
instead.The same URL ascreateAbsoluteBaseUrl(IServerBridgeRequest)
.- Parameters:
p_request
- The request.- Returns:
- The URL.
- Throws:
MalformedURLException
- If a parsing error occurred.
-
createAbsoluteBaseDirectoryUrl
@Deprecated public static URL createAbsoluteBaseDirectoryUrl(de.uplanet.lucy.server.connector.IRequestProcessingContext p_ctx) throws MalformedURLException Deprecated.UsecreateAbsoluteBaseUrl(IRequestProcessingContext)
instead.The same URL ascreateAbsoluteBaseUrl(IRequestProcessingContext)
.- Parameters:
p_ctx
- The processing context.- Returns:
- The URL.
- Throws:
MalformedURLException
- If a parsing error occurred.
-
createRequestBaseDirectoryUrl
@Deprecated public static URL createRequestBaseDirectoryUrl(IServerBridgeRequest p_request) throws MalformedURLException Deprecated.- Parameters:
p_request
- The request.- Returns:
- The URL.
- Throws:
MalformedURLException
-
createRequestBaseDirectoryUrl
@Deprecated public static URL createRequestBaseDirectoryUrl(de.uplanet.lucy.server.connector.IRequestProcessingContext p_ctx) throws MalformedURLException Deprecated.- Parameters:
p_ctx
- The processing context.- Returns:
- The URL.
- Throws:
MalformedURLException
-
createAbsoluteBaseUrl(IRequestProcessingContext)
instead.