protected static File platformIndependentUriToFile ( final URI fileURI ) { File file ; try { file = new File ( fileURI ) ; } catch ( IllegalArgumentException e ) { if ( fileURI . toString ( ) . startsWith ( "file://" ) ) { file = new File ( fileURI . toString ( ) . substring ( "file://" . length ( ) ) ) ; } else { throw e ; } } return file ; }
Convert a url to a file object . No checks are made to see if file exists but there are some hacks that are needed to convert uris to files across platforms .