Class URLs

java.lang.Object
org.zkoss.util.URLs

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

    • URLs

      public URLs()
  • Method Details

    • sanitizeURL

      public static URL sanitizeURL(URL url) throws MalformedURLException, URISyntaxException
      Sanitizes a URL for resource loading.

      Only http/https URLs keep the legacy URIBuilder rebuild; a URL of any other protocol is returned unchanged, so the declared exceptions can only be thrown for http/https URLs.

      Parameters:
      url - The URL to be sanitized.
      Returns:
      The sanitized URL.
      Throws:
      MalformedURLException - If an http/https URL cannot be reconstructed.
      URISyntaxException - If an http/https URL is not formatted strictly according to RFC2396 and cannot be converted to a URI.