All Downloads are FREE. Search and download functionalities are using the official Maven repository.

bsh.commands.pathToFile.bsh Maven / Gradle / Ivy

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