Package org.zkoss.util
Class URLs
- java.lang.Object
-
- org.zkoss.util.URLs
-
public class URLs extends java.lang.ObjectUtility 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.URLsanitizeURL(java.net.URL url)Sanitizes a URL for resource loading.
-
-
-
Method Detail
-
sanitizeURL
public static java.net.URL sanitizeURL(java.net.URL url) throws java.net.MalformedURLException, java.net.URISyntaxExceptionSanitizes a URL for resource loading.Only
http/httpsURLs keep the legacy URIBuilder rebuild; a URL of any other protocol is returned unchanged, so the declared exceptions can only be thrown forhttp/httpsURLs.- Parameters:
url- The URL to be sanitized.- Returns:
- The sanitized URL.
- Throws:
java.net.MalformedURLException- If an http/https URL cannot be reconstructed.java.net.URISyntaxException- If an http/https URL is not formatted strictly according to RFC2396 and cannot be converted to a URI.
-
-