bsh.Interpreter.getu()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(1.2k)|赞(0)|评价(0)|浏览(137)

本文整理了Java中bsh.Interpreter.getu()方法的一些代码示例,展示了Interpreter.getu()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Interpreter.getu()方法的具体详情如下:
包路径:bsh.Interpreter
类名称:Interpreter
方法名:getu

Interpreter.getu介绍

[英]Unchecked get for internal use
[中]未选中获取供内部使用

代码示例

代码示例来源:origin: beanshell/beanshell

/**
  Localize a path to the file name based on the bsh.cwd interpreter
  working directory.
*/
public File pathToFile( String fileName )
  throws IOException
{
  File file = new File( fileName );
  // if relative, fix up to bsh.cwd
  if ( !file.isAbsolute() ) {
    String cwd = (String)getu("bsh.cwd");
    file = new File( cwd + File.separator + fileName );
  }
  // The canonical file name is also absolute.
  // No need for getAbsolutePath() here...
  return new File( file.getCanonicalPath() );
}

代码示例来源:origin: jitlogic/zorka

/**
  Localize a path to the file name based on the bsh.cwd interpreter 
  working directory.
*/
public File pathToFile( String fileName ) 
  throws IOException
{
  File file = new File( fileName );
  // if relative, fix up to bsh.cwd
  if ( !file.isAbsolute() ) {
    String cwd = (String)getu("bsh.cwd");
    file = new File( cwd + File.separator + fileName );
  }
  // The canonical file name is also absolute.
  // No need for getAbsolutePath() here...
  return new File( file.getCanonicalPath() );
}

相关文章