common_helper/src/main/java/com/xiongyingqi/util/FileHelper.java
public static URL toURL(File file) {
        if (file == null || !file.exists()) {
            return null;
        }
        URI uri = file.toURI();
        URL url = null;
        try {
            url = uri.toURL();
        } catch (MalformedURLException e) {
            LOGGER.error(e);
        }
        return url;
    }
public static URL toURL(File file) {
        if (file == null || !file.exists()) {
            return null;
        }
        URI uri = file.toURI();
        URL url = null;
        try {
            url = uri.toURL();
        } catch (MalformedURLException e) {
            LOGGER.error(e);
        }
        return url;
    }
public static URL toURL ( File file ) { if ( file == null || ! file . exists ( ) ) { return null ; } URI uri = file . toURI ( ) ; URL url = null ; try { url = uri . toURL ( ) ; } catch ( MalformedURLException e ) { LOGGER . error ( e ) ; } return url ; }
将文件转换为URL地址 <br>
2013-9-2 下午10:07:14

@param file
@return
将文件转换为URL地址 <br > 2013 - 9 - 2 下午10 : 07 : 14