Klasse UrlBuilder
java.lang.Object
de.uplanet.lucy.server.auxiliaries.UrlBuilder
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungcreateAbsoluteBaseDirectoryUrl(de.uplanet.lucy.server.connector.IRequestProcessingContext p_ctx) Veraltet.Veraltet.UsecreateAbsoluteBaseUrl(IServerBridgeRequest)instead.createAbsoluteBaseUrl(de.uplanet.lucy.server.connector.IRequestProcessingContext p_ctx) createAbsoluteBaseUrl(IServerBridgeRequest p_request) Create an absolute base URL from the given request.createAbsoluteRequestBaseDirectoryUrl(de.uplanet.lucy.server.connector.IRequestProcessingContext p_ctx) Reconstructs the URL the client used to make the request.Reconstructs the URL the client used to make the request.createBaseUrl(de.uplanet.lucy.server.connector.IRequestProcessingContext p_ctx) Create a base URL, i.e. a relative URL containing solely the root path/.createBaseUrl(IServerBridgeRequest p_request) Create a base URL, i.e. a relative URL containing solely the root path/.createDefaultUrl(de.uplanet.lucy.server.connector.IRequestProcessingContext p_ctx) Veraltet.UsecreateBaseUrl(IRequestProcessingContext)instead.createDefaultUrl(IServerBridgeRequest p_request) Veraltet.UsecreateBaseUrl(IServerBridgeRequest)instead.createRequestBaseDirectoryUrl(de.uplanet.lucy.server.connector.IRequestProcessingContext p_ctx) Veraltet.Veraltet.createWebSocketBaseUrl(de.uplanet.lucy.server.connector.IRequestProcessingContext p_ctx) createWebSocketBaseUrl(IServerBridgeRequest p_request) Create a WebSocket URL from the given request.Percent encode the given URI using UTF-8 as character set..booleanisSafeWebUrl(String p_strUrl) CallsisSafeWebUrl(String, boolean)with the second parameter set tofalseto disallow single quotes in the URL.booleanisSafeWebUrl(String p_strUrl, boolean p_bAllowSingleQuotes) Check if the given URL is a safe URL in Intrexx' sense.booleanisValidUri(String p_str) Validate given URLs.booleanisValidUrl(String p_str) Validate given URLs.Create an URI object from the given URI.Create an URL from the given string.
-
Konstruktordetails
-
UrlBuilder
public UrlBuilder()
-
-
Methodendetails
-
createBaseUrl
Create a base URL, i.e. a relative URL containing solely the root path/.- Parameter:
p_request- The request.- Gibt zurück:
- The
/base URL.
-
createBaseUrl
Create a base URL, i.e. a relative URL containing solely the root path/.- Parameter:
p_ctx- The processing context.- Gibt zurück:
- The
/base URL. - Siehe auch:
-
createAbsoluteBaseUrl
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.
- Parameter:
p_request- The request.- Gibt zurück:
- The base URL.
- Löst aus:
MalformedURLException- If a parsing error occurred.
- First, if the
-
createAbsoluteBaseUrl
public URL createAbsoluteBaseUrl(de.uplanet.lucy.server.connector.IRequestProcessingContext p_ctx) throws MalformedURLException - Löst aus:
MalformedURLException- Siehe auch:
-
createWebSocketBaseUrl
Create a WebSocket URL from the given request.This method uses the same algorithm as
createAbsoluteBaseUrl(IServerBridgeRequest)except that the scheme iswsorwssinstead ofhttporhttps.- Parameter:
p_request- The request.- Gibt zurück:
- The WebSocket URL.
- Löst aus:
MalformedURLException- If a parsing error occurred.- Siehe auch:
-
createWebSocketBaseUrl
public URL createWebSocketBaseUrl(de.uplanet.lucy.server.connector.IRequestProcessingContext p_ctx) throws MalformedURLException - Löst aus:
MalformedURLException- Siehe auch:
-
createAbsoluteRequestBaseDirectoryUrl
public 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.
- Parameter:
p_request- The request.- Gibt zurück:
- The request base directory URL.
- Löst aus:
MalformedURLException
-
createAbsoluteRequestBaseDirectoryUrl
public 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.
- Parameter:
p_ctx- The processing context.- Gibt zurück:
- The request base directory URL.
- Löst aus:
MalformedURLException- If a parsing error occurred.- Siehe auch:
-
parseUrl
Create an URL from the given string.- Parameter:
p_strUrl- The string to be parsed.- Gibt zurück:
- The URL.
- Löst aus:
MalformedURLException- If a parsing error occurred.
-
isValidUri
Validate given URLs.- Parameter:
p_str- The URL.- Gibt zurück:
trueif the URL is valid, orfalseotherwise.
-
isValidUrl
Validate given URLs.- Parameter:
p_str- The URL.- Gibt zurück:
trueif the URL is valid, orfalseotherwise.
-
isSafeWebUrl
CallsisSafeWebUrl(String, boolean)with the second parameter set tofalseto disallow single quotes in the URL.- Parameter:
p_strUrl- The URL.- Gibt zurück:
trueif the URL is considered safe, orfalseotherwise.
-
isSafeWebUrl
Check if the given URL is a safe URL in Intrexx' sense.The URL must meet the following conditions to be considered a safe Web ULR:
- The URL must only contain characters allowed by the spec (http://tools.ietf.org/html/rfc3986).
- The URL must not contain numeric or named HTML character references.
- The scheme must be either
http, orhttps, orftp, or the URL must be a relative URL. - If the URL is absolute it must have an authority part.
- If the URL is relative it must not have an authority part.
- Parameter:
p_strUrl- The URL.p_bAllowSingleQuotes-trueif single quotes are allowed to occur in the attribute value, orfalseotherwise.- Gibt zurück:
trueif the URL is considered safe, orfalseotherwise.
-
parseUri
Create an URI object from the given URI.- Parameter:
p_strUri- The URI.- Gibt zurück:
- An URI object.
- Löst aus:
URISyntaxException- If a syntax error occurred.
-
encodeUri
Percent encode the given URI using UTF-8 as character set..- Parameter:
p_strUri- The URI.- Gibt zurück:
- The encoded URI.
- Löst aus:
URISyntaxException- If a syntax error occurred.
-
createDefaultUrl
Veraltet.UsecreateBaseUrl(IServerBridgeRequest)instead.The same ascreateBaseUrl(IServerBridgeRequest).- Parameter:
p_request- The request.- Gibt zurück:
- The URL.
-
createDefaultUrl
@Deprecated public URL createDefaultUrl(de.uplanet.lucy.server.connector.IRequestProcessingContext p_ctx) Veraltet.UsecreateBaseUrl(IRequestProcessingContext)instead.The same ascreateBaseUrl(IRequestProcessingContext).- Parameter:
p_ctx- The processing context.- Gibt zurück:
- The URL.
-
createAbsoluteBaseDirectoryUrl
@Deprecated public URL createAbsoluteBaseDirectoryUrl(IServerBridgeRequest p_request) throws MalformedURLException Veraltet.UsecreateAbsoluteBaseUrl(IServerBridgeRequest)instead.The same ascreateAbsoluteBaseUrl(IServerBridgeRequest).- Parameter:
p_request- The request.- Gibt zurück:
- The URL.
- Löst aus:
MalformedURLException- If a parsing error occurred.
-
createAbsoluteBaseDirectoryUrl
@Deprecated public URL createAbsoluteBaseDirectoryUrl(de.uplanet.lucy.server.connector.IRequestProcessingContext p_ctx) throws MalformedURLException Veraltet.UsecreateAbsoluteBaseUrl(IRequestProcessingContext)instead.The same ascreateAbsoluteBaseUrl(IRequestProcessingContext).- Parameter:
p_ctx- The processing context.- Gibt zurück:
- The URL.
- Löst aus:
MalformedURLException- If a parsing error occurred.
-
createRequestBaseDirectoryUrl
@Deprecated public URL createRequestBaseDirectoryUrl(IServerBridgeRequest p_request) throws MalformedURLException Veraltet.- Parameter:
p_request- The request.- Gibt zurück:
- The URL.
- Löst aus:
MalformedURLException- If a parsing error occurred.
-
createRequestBaseDirectoryUrl
@Deprecated public URL createRequestBaseDirectoryUrl(de.uplanet.lucy.server.connector.IRequestProcessingContext p_ctx) throws MalformedURLException Veraltet.- Parameter:
p_ctx- The processing context.- Gibt zurück:
- The URL.
- Löst aus:
MalformedURLException- If a parsing error occurred.
-
createAbsoluteBaseUrl(IRequestProcessingContext)instead.