private static URL toUrl ( File file ) { try { return file == null ? null : file . toURI ( ) . toURL ( ) ; } catch ( Exception e ) { throw new IllegalArgumentException ( "Can't get URL for file=" + file ) ; } }
Returns a URL for the given file .