Constructs a URL instance based on the specified URL string, taking into account the fact that the specified URL string may represent an "about:..." URL, a "javascript:..." URL, or a data:... URL. The caller should be sure that URL strings passed to
(final String url)
| 206 | * @return the constructed URL instance |
| 207 | */ |
| 208 | public static URL toUrlSafe(final String url) { |
| 209 | try { |
| 210 | return toUrlUnsafe(url); |
| 211 | } |
| 212 | catch (final MalformedURLException e) { |
| 213 | // Should never happen. |
| 214 | throw new RuntimeException(e); |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | /** |
| 219 | * <p>Constructs a URL instance based on the specified URL string, taking into account the fact that the |