com.vaadin.flow.internal.
Class UrlUtil
- java.lang.Object
-
- com.vaadin.flow.internal.UrlUtil
-
public class UrlUtil extends Object
Internal utility class for URL handling.
For internal use only. May be renamed or removed in a future release.
Since:
2.0
Author:
Vaadin Ltd
-
-
Method Summary
All Methods Modifier and Type Method Description static String
encodeURI(String uri)
Encodes a full URI.
static String
encodeURIComponent(String path)
Encodes a path segment of a URI.
static String
getStaticVaadinPathInfo(VaadinRequest request)
Gets the path info for a /VAADIN/something request.
static String
getStaticVaadinPathInfo(javax.servlet.http.HttpServletRequest request)
Gets the path info for a /VAADIN/something request.
static boolean
isExternal(String url)
checks if the given url is an external URL (e.g.
-
-
-
Method Detail
-
isExternal
public static boolean isExternal(String url)
checks if the given url is an external URL (e.g. staring with http:// or https://) or not.
Parameters:
url
- is the url to be checked.Returns:
true if the url is external otherwise false.
-
encodeURI
public static String encodeURI(String uri)
Encodes a full URI.
Corresponds to encodeURI in JavaScript https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI
The path can contain
/
and other special URL characters as these will not be encoded. SeeencodeURIComponent(String)
if you want to encode all special characters.The following characters are not escaped: A-Za-z0-9;,/?:@&=+$-_.!~*'()#
Parameters:
uri
- the uri to encode
-
encodeURIComponent
public static String encodeURIComponent(String path)
Encodes a path segment of a URI.
Corresponds to encodeURIComponent in JavaScript https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent
The following characters are not escaped: A-Za-z0-9-_.!~*'()
Parameters:
path
- the path to encode
-
getStaticVaadinPathInfo
public static String getStaticVaadinPathInfo(VaadinRequest request)
Gets the path info for a /VAADIN/something request.
Parameters:
request
- the servlet requestReturns:
the path info starting with /VAADIN/ or
null
if no path information is available
-
getStaticVaadinPathInfo
public static String getStaticVaadinPathInfo(javax.servlet.http.HttpServletRequest request)
Gets the path info for a /VAADIN/something request.
Parameters:
request
- the servlet requestReturns:
the path info starting with /VAADIN/ or
null
if no path information is available
-
-