Added WebUtil#toURL(File)

This commit is contained in:
Parnassian
2014-02-26 19:14:49 +01:00
parent c10d224904
commit 3f24b008cc
@@ -185,5 +185,19 @@ public class WebUtil {
t.printStackTrace();
}
}
/**
* Converts file format to url format
* @param file
* @return url to file
*/
public static URL toURL(File file) {
try {
return file.toURI().toURL();
} catch (MalformedURLException e) {
e.printStackTrace();
}
return null;
}
}