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

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

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

Interpreter.redirectOutputToFile介绍

暂无

代码示例

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

static void staticInit()
{
  try {
    Console.systemLineSeparator = System.getProperty("line.separator");
    Console.debug = System.err;
    DEBUG.set(Boolean.getBoolean("debug"));
    TRACE = Boolean.getBoolean("trace");
    COMPATIBIILTY = Boolean.getBoolean("bsh.compatibility");
    String outfilename = System.getProperty("outfile");
    if ( outfilename != null )
      redirectOutputToFile( outfilename );
  } catch ( SecurityException e ) {
    System.err.println("Could not init static:"+e);
  } catch ( Exception e ) {
    System.err.println("Could not init static(2):"+e);
  } catch ( Throwable e ) {
    System.err.println("Could not init static(3):"+e);
  }
}

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

static void staticInit() 
{
/* 
  Apparently in some environments you can't catch the security exception
  at all...  e.g. as an applet in IE  ... will probably have to work 
  around 
*/
  try {
    systemLineSeparator = System.getProperty("line.separator");
    debug = System.err;
    DEBUG = Boolean.getBoolean("debug");
    TRACE = Boolean.getBoolean("trace");
    LOCALSCOPING = Boolean.getBoolean("localscoping");
    String outfilename = System.getProperty("outfile");
    if ( outfilename != null )
      redirectOutputToFile( outfilename );
  } catch ( SecurityException e ) { 
    System.err.println("Could not init static:"+e);
  } catch ( Exception e ) {
    System.err.println("Could not init static(2):"+e);
  } catch ( Throwable e ) { 
    System.err.println("Could not init static(3):"+e);
  }
}

相关文章