Package org.apache.felix.hc.generalchecks.util

## Class ScriptHelper

- java.lang.Object
- - org.apache.felix.hc.generalchecks.util.ScriptHelper

    public class ScriptHelper
    extends Object

Script Helper to simplify interaction with scripting engines in OSGi context. Used by ScriptedHealthCheck and can be used by other custom checks that want to allow to evaluate expressions via a scripting engine.

### Constructor Summary

Constructors
`ScriptHelper()`

### Method Summary

All Methods Instance Methods Concrete Methods
`Object` `evalScript​(org.osgi.framework.BundleContext bundleContext, ScriptEngine scriptEngine, String scriptToExecute, org.apache.felix.hc.api.FormattingResultLog log, Map<String,​Object> additionalBindings, boolean logScriptResult)`
`String` `getFileContents​(String url)`
`ScriptEngine` `getScriptEngine​(ScriptEnginesTracker scriptEnginesTracker, String language)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ScriptHelper

    public ScriptHelper()

### Method Detail

#### getFileContents

    public String getFileContents​(String url)

#### getScriptEngine

    public ScriptEngine getScriptEngine​(ScriptEnginesTracker scriptEnginesTracker,
                                        String language)

#### evalScript

    public Object evalScript​(org.osgi.framework.BundleContext bundleContext,
                             ScriptEngine scriptEngine,
                             String scriptToExecute,
                             org.apache.felix.hc.api.FormattingResultLog log,
                             Map<String,​Object> additionalBindings,
                             boolean logScriptResult)
                      throws ScriptException,
                             IOException

Throws:
  `ScriptException`
  `IOException`