MCPcopy Index your code
hub / github.com/HtmlUnit/htmlunit / toUrlSafe

Method toUrlSafe

src/main/java/org/htmlunit/util/UrlUtils.java:208–216  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 6

toUrlSafeMethod · 0.95
getUrlMethod · 0.95
getUrlMethod · 0.95
setHashMethod · 0.95
createNewUrlMethod · 0.95

Calls 1

toUrlUnsafeMethod · 0.95

Tested by 2

toUrlSafeMethod · 0.76