public File pathToFile ( String fileName ) throws IOException { String cwd = ( String ) getu ( "bsh.cwd" ) ; File file = new File ( fileName ) ; // if relative, fix up to bsh.cwd if ( ! file . isAbsolute ( ) ) { file = new File ( cwd + File . separator + fileName ) ; } return new File ( file . getCanonicalPath ( ) ) ; }
Localize a path to the file name based on the bsh . cwd interpreter working directory .