public static File toFile ( final String filename ) { if ( filename == null ) { return null ; } String f ; try { f = URLDecoder . decode ( filename , UTF8 ) ; } catch ( final UnsupportedEncodingException e ) { throw new RuntimeException ( e ) ; } f = f . replace ( WINDOWS_SEPARATOR , File . separator ) . replace ( UNIX_SEPARATOR , File . separator ) ; return new File ( f ) ; }
Convert URI or chimera references to file paths .