public static void executeScriptResources ( File scriptsDir ) throws IOException { if ( scriptsDir . isDirectory ( ) ) { List < File > scriptFiles = Utils . listAllFiles ( scriptsDir ) ; Logger logger = Logger . getLogger ( AgentUtils . class . getName ( ) ) ; for ( File script : scriptFiles ) { if ( script . getName ( ) . contains ( Constants . SCOPED_SCRIPT_AT_AGENT_SUFFIX ) ) { script . setExecutable ( true ) ; String [ ] command = { script . getAbsolutePath ( ) } ; try { ProgramUtils . executeCommand ( logger , command , script . getParentFile ( ) , null , null , null ) ; } catch ( InterruptedException e ) { Utils . logException ( logger , e ) ; } } } } }
Executes a script resource on a given instance .