
bsh.commands.pathToFile.bsh Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bsh-console Show documentation
Show all versions of bsh-console Show documentation
A BeanShell console with history, autocompletion and more...
The newest version!
/**
Create a File object corresponding to the specified file path name, taking
into account the bsh current working directory (bsh.cwd)
*/
bsh.help.pathToFile = "usage: File pathToFile( String )";
File pathToFile( String filename ) {
File file = new File(filename);
// if relative, fix up to bsh.cwd
if ( !file.isAbsolute() ) {
file = new File(bsh.cwd, filename);
}
// The canonical file name is also absolute.
// No need for getAbsolutePath() here...
return file.getCanonicalFile();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy