* @param file the file to be converted into an URL
* @return URL
* @throws java.net.MalformedURLException when error occurred
*/
static URL toURL(File file) throws MalformedURLException {
if (new SystemUtils().isJavaVersionAtLeast(JAVA_1_4)) {
try {
Method toURI = file.getClass().getMethod("toURI", (Class[]) null);
Object uri = toURI.invoke(file, (Class[]) null);
Method toURL = uri.getClass().getMethod("toURL", (Class[]) null);