Package org.zkoss.util
Class URLs
java.lang.Object
org.zkoss.util.URLs
Utility class for URL operations.
- Since:
- 10.0.1
- Author:
- jumperchen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic URLsanitizeURL(URL url) Sanitizes a URL for resource loading.
-
Constructor Details
-
URLs
public URLs()
-
-
Method Details
-
sanitizeURL
Sanitizes 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:
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.
-