Class URLs


  • public class URLs
    extends java.lang.Object
    Utility class for URL operations.
    Since:
    10.0.1
    Author:
    jumperchen
    • Constructor Summary

      Constructors 
      Constructor Description
      URLs()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.net.URL sanitizeURL​(java.net.URL url)
      Sanitizes a URL to prevent MalformedURLException and SSRF warning.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • URLs

        public URLs()
    • Method Detail

      • sanitizeURL

        public static java.net.URL sanitizeURL​(java.net.URL url)
                                        throws java.net.MalformedURLException,
                                               java.net.URISyntaxException
        Sanitizes a URL to prevent MalformedURLException and SSRF warning.
        Parameters:
        url - The URL to be sanitized.
        Returns:
        The sanitized URL.
        Throws:
        java.net.MalformedURLException - If the URL is not in the correct format.
        java.net.URISyntaxException - If the URL is not formatted strictly according to RFC2396 and cannot be converted to a URI.