question: private static URL fileToURL ( File file ) { String name ; try { name = file . getCanonicalPath ( ) ; } catch ( IOException e ) { name = file . getAbsolutePath ( ) ; } name = name . replace ( File . separatorChar , '/' ) ; if ( ! name . startsWith ( "/" ) ) { name = "/" + name ; } if ( ! file . isFile ( ) ) { name = name + "/" ; } try { return new URL ( "file" , "" , name ) ; } catch ( MalformedURLException e ) { throw new IllegalArgumentException ( "file" ) ; } }
target:  Returns the directory or JAR file URL corresponding to the specified local file name.