Package xyz.cp74.utils
Class UrlUtils
- java.lang.Object
-
- xyz.cp74.utils.UrlUtils
-
public class UrlUtils extends Object
UrlUtils Do some things with URLs- Author:
- Christian Paul
-
-
Constructor Summary
Constructors Constructor Description UrlUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringencodeUrl(String url)Encode @param urlstatic StringencodeUrl2(String url)Encode @param urlstatic StringgetDomain(String url)Get domain of @param urlstatic StringgetHost(String url)Get host from urlstatic StringgetHost(String url, boolean toLowerCase)Get host from urlstatic StringgetProtocoll(String url)Check @param url and @return protocollstatic booleanisRelative(String url)Check if @param url is relativestatic StringremoveHost(String url)Remove host from @param urlstatic Stringresolve(String baseUrl, String url)Resolve @param baseUrl with @param url
-
-
-
Method Detail
-
getHost
public static String getHost(String url)
Get host from url- Parameters:
url- the url- Returns:
- host
-
getHost
public static String getHost(String url, boolean toLowerCase)
Get host from url- Parameters:
url- the urltoLowerCase- lower case the host- Returns:
- host
-
removeHost
public static String removeHost(String url)
Remove host from @param url- Returns:
- absolute path
-
resolve
public static String resolve(String baseUrl, String url)
Resolve @param baseUrl with @param url- Returns:
- resolved URL
-
isRelative
public static boolean isRelative(String url)
Check if @param url is relative- Returns:
- true, if relative
-
-