/** * Make a URL from the given string. * * @see #toURL(String,String) * * @param urlspec The string to construct a URL for. * @return A URL for the given string. * * @throws MalformedURLException Could not make a URL for the given string. */ public static URL toURL(final String urlspec) throws MalformedURLException { return toURL(urlspec, null); }
/** * Returns a URL for the input object converted to a string. * * @return a URL object * * @throws NestedRuntimeException An MalformedURLException occured. */ public Object getValue() { try { return Strings.toURL(getAsText()); } catch (MalformedURLException e) { throw new NestedRuntimeException(e); } } }
try target = Strings.toURL(ourPath);
target = Strings.toURL(ourPath);