public class ClientUrlHelper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
MODULE_MICROBLOG
Name of the microblogging module.
|
Modifier and Type | Method and Description |
---|---|
static void |
appendUrlPath(StringBuilder url,
String urlPath)
Appends a urlPath to the provided url if the urlPath is not empty or blank
|
static String |
getClientId(String urlPart)
Gets the client id from the URL part.
|
static String |
prependModuleClientPart(String urlPath)
Prepends the module and client ID of the current client to the provided URL path.
|
static String |
prependModuleClientPart(String clientId,
String urlPath)
Prepends the module and client ID to the provided URL path.
|
static String |
removeIds(String uri)
Removes the module and client id from the given uri.
|
static String |
renderConfiguredAbsoluteUrl(String urlPath,
boolean isSecure)
Renders an absolute URL pointing to a resource on the current client.
|
static String |
renderConfiguredAbsoluteUrl(String clientId,
String urlPath,
boolean isSecure,
boolean staticResource)
Renders an absolute URL pointing to a resource on the given client.
|
public static final String MODULE_MICROBLOG
public static void appendUrlPath(StringBuilder url, String urlPath)
url
- the URL to extend. The URL is expected to not have a trailing '/'.urlPath
- the path to append. Can be null or empty and does not have to start with a '/'.public static String getClientId(String urlPart)
urlPart
- the part of the URL after the contextpublic static String prependModuleClientPart(String urlPath)
urlPath
- path to a resource to be prepended. The path doesn't have to start with a '/' and
can be null.public static String prependModuleClientPart(String clientId, String urlPath)
clientId
- the client ID to include. Can be null which will lead to including the ID of the
current client.urlPath
- path to a resource to be prepended. The path doesn't have to start with a '/' and
can be null.public static String removeIds(String uri)
uri
- the uripublic static String renderConfiguredAbsoluteUrl(String urlPath, boolean isSecure)
urlPath
- a (relative) URL path without client and module information, can be empty or nullisSecure
- whether the URL should be rendered with the HTTPS or HTTP protocol. If the
configuration states that HTTPS is not supported, the returned URL will use the
HTTP protocol.public static String renderConfiguredAbsoluteUrl(String clientId, String urlPath, boolean isSecure, boolean staticResource)
clientId
- the client ID to include. Can be null which will lead to including the ID of the
current client.urlPath
- a (relative) URL path without client and module information, can be empty or nullisSecure
- whether the URL should be rendered with the HTTPS or HTTP protocol. If the
configuration states that HTTPS is not supported, the returned URL will use the
HTTP protocol.staticResource
- true if the url should be rendered as a resource not to be delivered by the
dispatcher servletCopyright © 2019 Communote team. All rights reserved.