Class URIHelper


  • public class URIHelper
    extends Object
    Helper class for URIs
    • Constructor Detail

      • URIHelper

        public URIHelper()
    • Method Detail

      • getDomain

        public static String getDomain​(URI uri)
        Returns the domain, which is the scheme and host. Differs from getOrigin(URI) in the sense that doesn't force the default ports
      • getOrigin

        public static String getOrigin​(URI uri)
        Returns the "JavaScript origin" from the given URI, that means: scheme, host and port. Basically, ignores the path and query parameters
      • inSameOrigin

        public static boolean inSameOrigin​(Stream<String> uris)
        Indicates whether all the non-null uris in the given stream belong to the same domain
      • of

        public static URI of​(String uri)
        Same as creating an URI from the given string, but returning null if invalid instead of throwing an URISyntaxException.