@Test public void testUrlToFileWithNull() { File result = URLUtil.urlToFile(null); assertEquals(null, result); }
public static File urlToFile(URL url) { if (!URLUtil.isFileUrl(url)) { return null; } try { return new File(url.toURI()); } catch (Exception e1) { try { return new File(url.getPath()); } catch (Exception e2) { } } return null; }
URLUtil { public static File urlToFile(URL url) { if (!URLUtil.isFileUrl(url)) { return null; } try { return new File(url.toURI()); } catch (Exception e1) { try { return new File(url.getPath()); } catch (Exception e2) { } } return null; } }
URLUtil { public static File urlToFile(URL url) { if (!URLUtil.isFileUrl(url)) { return null; } try { return new File(url.toURI()); } catch (Exception e1) { try { return new File(url.getPath()); } catch (Exception e2) { } } return null; }  }
URLUtil { public static File urlToFile(URL url) { if (!URLUtil.isFileUrl(url)) { return null; } try { return new File(url.toURI()); } catch (Exception e1) { try { return new File(url.getPath()); } catch (Exception e2) { } } return null; }  static boolean isHttpsUrl(URL url); static boolean isHttpUrl(URL url); static boolean isFileUrl(URL url); static boolean isForResourceWithExtension(URL url, String extension); static URL stripQuery(URL url); static File urlToFile(URL url); static URL fromString(String urlString); static URL fromString(String urlString, String protocol); static URL fromObject(Object source); static URI toURI(URL url); static String addQueryParameter(String urlString, String queryParameter); static String addQueryParameterIfMissing(String urlString, String queryParameter, boolean ignoreCase); static boolean hasQueryParameter(String urlString, String queryParameter, boolean ignoreCase); }
URLUtil { public static File urlToFile(URL url) { if (!URLUtil.isFileUrl(url)) { return null; } try { return new File(url.toURI()); } catch (Exception e1) { try { return new File(url.getPath()); } catch (Exception e2) { } } return null; }  static boolean isHttpsUrl(URL url); static boolean isHttpUrl(URL url); static boolean isFileUrl(URL url); static boolean isForResourceWithExtension(URL url, String extension); static URL stripQuery(URL url); static File urlToFile(URL url); static URL fromString(String urlString); static URL fromString(String urlString, String protocol); static URL fromObject(Object source); static URI toURI(URL url); static String addQueryParameter(String urlString, String queryParameter); static String addQueryParameterIfMissing(String urlString, String queryParameter, boolean ignoreCase); static boolean hasQueryParameter(String urlString, String queryParameter, boolean ignoreCase);  }