public abstract class URLUtil extends Object
Modifier and Type | Method and Description |
---|---|
static PageWebResource |
getFirstPageWebResource(ChannelWebResource cwr)
Returns the page web resource for the first page whithin the channel of the given channel web resource.
|
static String |
getHost(URI uri)
Returns the host of the given URI or
null if none could be inferred. |
static String |
getRefererPath(String referer,
IWebsiteBaseURL baseURL,
HttpServletRequest request)
Get the Web Resource path from the given URL
|
static String |
getRefererRelativeUri(String referer,
IWebsiteBaseURL baseURL,
HttpServletRequest request)
Returns the URI relative to the application root, without the mode root path, including the query string.
|
static URI |
removeDefaultPort(URI uri)
Remove default port of the given URI.
It removes the port if: The scheme is http and the port is 80 ; or
The scheme is https and the port is 443
If the given URI is not absolute, is opaque or doesn't fit the above rule, the original URI will be returned. |
public static String getRefererPath(String referer, IWebsiteBaseURL baseURL, HttpServletRequest request)
referer
- The URL to get the path frombaseURL
- The WebsiteBaseURLrequest
- The HttpServletRequestpublic static String getRefererRelativeUri(String referer, IWebsiteBaseURL baseURL, HttpServletRequest request)
referer
- The URL to get the path frombaseURL
- The WebsiteBaseURLrequest
- The HttpServletRequestpublic static PageWebResource getFirstPageWebResource(ChannelWebResource cwr) throws PortalException
This method requires a current session and a current transaction.
cwr
- the channel web resource.PortalException
public static String getHost(URI uri)
null
if none could be inferred.uri
- the URI.null
if none could be inferred.public static URI removeDefaultPort(URI uri)
http
and the port is 80
; or
https
and the port is 443
uri
- the URI to have its default port removed.NullPointerException
- if the given URI is null
.LumisXP 12.3.0.200408 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.