Package org.fluentlenium.utils
Class UrlUtils
- java.lang.Object
-
- org.fluentlenium.utils.UrlUtils
-
public final class UrlUtils extends Object
Utils class for Url manipulation.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
concat(String baseUriSpec, String uriSpec)
Concatenate 2 URL Strings.static String
getAbsoluteUrlFromFile(String file)
Converts a file String to a valid URL String.
Example:index.html
converts tofile://C:/path/to/file/index.html
.static String
getAbsoluteUrlPathFromFile(String file)
Removes file name from URL stringstatic String
sanitizeBaseUrl(String baseUriSpec, String uriSpec)
Sanitize base url from current url by using the same scheme if http/https.
-
-
-
Method Detail
-
concat
public static String concat(String baseUriSpec, String uriSpec)
Concatenate 2 URL Strings.- Parameters:
baseUriSpec
- base urluriSpec
- path part- Returns:
- Concat URL
-
sanitizeBaseUrl
public static String sanitizeBaseUrl(String baseUriSpec, String uriSpec)
Sanitize base url from current url by using the same scheme if http/https.- Parameters:
baseUriSpec
- base URIuriSpec
- current URI- Returns:
- Sanitized base url
-
getAbsoluteUrlFromFile
public static String getAbsoluteUrlFromFile(String file)
Converts a file String to a valid URL String.
Example:index.html
converts tofile://C:/path/to/file/index.html
.- Parameters:
file
- the file String- Returns:
- the URL String
-
-