本文整理了Java中bsh.Interpreter.pathToFile()
方法的一些代码示例,展示了Interpreter.pathToFile()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Interpreter.pathToFile()
方法的具体详情如下:
包路径:bsh.Interpreter
类名称:Interpreter
方法名:pathToFile
[英]Localize a path to the file name based on the bsh.cwd interpreter working directory.
[中]基于bsh本地化文件名的路径。cwd解释器工作目录。
代码示例来源:origin: jitlogic/zorka
/**
Read text from fileName and eval it.
*/
public Object source( String filename, NameSpace nameSpace )
throws FileNotFoundException, IOException, EvalError
{
File file = pathToFile( filename );
if ( Interpreter.DEBUG ) debug("Sourcing file: "+file);
Reader sourceIn = new BufferedReader( new FileReader(file) );
try {
return eval( sourceIn, nameSpace, filename );
} finally {
sourceIn.close();
}
}
代码示例来源:origin: beanshell/beanshell
String path;
try {
path = env.pathToFile( dir ).getAbsolutePath();
file = env.pathToFile( dir );
} catch (IOException e ) {
env.println("error reading path: "+e);
代码示例来源:origin: beanshell/beanshell
/**
Read text from fileName and eval it.
*/
public Object source( String filename, NameSpace nameSpace )
throws FileNotFoundException, IOException, EvalError
{
File file = pathToFile( filename );
Interpreter.debug("Sourcing file: ", file);
Reader sourceIn = new BufferedReader( new FileReader(file) );
try {
return eval( sourceIn, nameSpace, filename );
} finally {
sourceIn.close();
}
}
内容来源于网络,如有侵权,请联系作者删除!