Class UriUtil


  • public final class UriUtil
    extends Object
    Utility class for working with URIs and URLs.
    • Method Detail

      • hasScheme

        public static boolean hasScheme​(CharSequence uri)
        Determine if a URI string has a scheme component.
        Parameters:
        uri - The URI to test
        Returns:
        true if a scheme is present, otherwise {code @false}
      • warToJar

        public static URL warToJar​(URL warUrl)
                            throws IOException
        Convert a URL of the form war:file:... to jar:file:....
        Parameters:
        warUrl - The WAR URL to convert
        Returns:
        The equivalent JAR URL
        Throws:
        IOException - If the conversion fails
      • getWarSeparator

        public static String getWarSeparator()
      • isAbsoluteURI

        public static boolean isAbsoluteURI​(String path)
        Does the provided path start with file:/ or <protocol>://.
        Parameters:
        path - The path to test
        Returns:
        true if the supplied path starts with once of the recognised sequences.