com.vaadin.flow.router.internal.
Class PathUtil
All Implemented Interfaces:
Utility class which contains various methods for parsing a route url into segments.
For internal use only. May be renamed or removed in a future release.
See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Join the segments into a url path.
static String
Join the segments into a url path.
getSegmentsList
(String path) Returns an unmodifiable list containing the segments of the specified path.
static String
Trim the path by removing any leading and trailing whitespaces and slashes.
static String
trimSegmentsString
(String path) Trim the path by removing any leading and trailing whitespaces and trailing slashes.
-
Constructor Details
-
PathUtil
public PathUtil()
-
-
Method Details
-
getSegmentsList
Returns an unmodifiable list containing the segments of the specified path.
Parameters:
path
- url path to split into segments. The path may also start with a slash `/` but it may not contain the url protocol.Returns:
a List containing the segments of the path.
-
getPath
Join the segments into a url path.
Parameters:
segments
- path segments.Returns:
path form from input segments.
-
getPath
Join the segments into a url path.
Parameters:
basePath
- path prefix.segments
- path segments following the prefix.Returns:
the path form by concatenating basePath and segments.
-
trimPath
Trim the path by removing any leading and trailing whitespaces and slashes.
Parameters:
path
- url path to trim.Returns:
a String representing the input path without any leading and trailing whitespaces and slashes.
-
trimSegmentsString
Trim the path by removing any leading and trailing whitespaces and trailing slashes.
Parameters:
path
- url path to trim, not nullReturns:
a String representing the input path without any leading and trailing whitespaces or trailing slash.
-