Class URLUtils


  • public final class URLUtils
    extends Object
    Author:
    Tomas Hofman (thofman@redhat.com)
    • Field Detail

      • URL_REGEX_STRING

        public static final String URL_REGEX_STRING
        Supports domain names and IPv4. Is more permissive than spec of course. TODO: IPv6 support.
        See Also:
        Constant Field Values
    • Method Detail

      • extractURLs

        public static String[] extractURLs​(String source,
                                           Pattern initialMatchPattern,
                                           boolean multiple)
        Extracts URLs matching given pattern from given String.
        Parameters:
        source - String to extract URLs from.
        initialMatchPattern - Pattern that URLs must match.
        multiple - If false, return the first URL only, if true, return all.
        Returns:
        URLs matching initialMatchPattern
      • extractGHUrls

        public static String[] extractGHUrls​(String source,
                                             Pattern initialMatchPattern,
                                             boolean multiple)