Class UrlUtils


  • public class UrlUtils
    extends Object
    UrlUtils Do some things with URLs
    Author:
    Christian Paul
    • Constructor Detail

      • UrlUtils

        public UrlUtils()
    • Method Detail

      • getDomain

        public static String getDomain​(String url)
        Get domain of @param url
        Returns:
        domain
      • 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 url
        toLowerCase - 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
      • encodeUrl

        public static String encodeUrl​(String url)
        Encode @param url
        Returns:
        encoded URL
      • encodeUrl2

        public static String encodeUrl2​(String url)
        Encode @param url
        Returns:
        encoded URL
      • getProtocoll

        public static String getProtocoll​(String url)
        Check @param url and @return protocoll