private ScriptPluginProvider getPlugin(
            final PluginMeta pluginMeta,
            final File file,
            final ProviderDef pluginDef,
            final ProviderIdent ident
    ) throws
            ProviderLoaderException, PluginException
    {
        if (null == fileExpandedDir) {
            final File dir;
            try {
                dir = expandScriptPlugin(file);
            } catch (IOException e) {
                throw new ProviderLoaderException(e, ident.getService(), ident.getProviderName());
            }
            fileExpandedDir = dir;
            if (pluginDef.getPluginType().equals("script")) {

                final File script = new File(fileExpandedDir, pluginDef.getScriptFile());
                //set executable bit for script-file of the provider
                try {
                    ScriptfileUtils.setExecutePermissions(script);
                } catch (IOException e) {
                    log.warn("Unable to set executable bit for script file: " + script + ": " + e.getMessage());
                }
            }
            debug("expanded plugin dir! " + fileExpandedDir);
        } else {
            debug("expanded plugin dir: " + fileExpandedDir);
        }
        if (pluginDef.getPluginType().equals("script")) {
            final File script = new File(fileExpandedDir, pluginDef.getScriptFile());
            if (!script.exists() || !script.isFile()) {
                throw new PluginException("Script file was not found: " + script.getAbsolutePath());
            }
        }
        return new ScriptPluginProviderImpl(pluginMeta, pluginDef, file, fileExpandedDir);
    }
private ScriptPluginProvider getPlugin ( final PluginMeta pluginMeta , final File file , final ProviderDef pluginDef , final ProviderIdent ident ) throws ProviderLoaderException , PluginException { if ( null == fileExpandedDir ) { final File dir ; try { dir = expandScriptPlugin ( file ) ; } catch ( IOException e ) { throw new ProviderLoaderException ( e , ident . getService ( ) , ident . getProviderName ( ) ) ; } fileExpandedDir = dir ; if ( pluginDef . getPluginType ( ) . equals ( "script" ) ) { final File script = new File ( fileExpandedDir , pluginDef . getScriptFile ( ) ) ; try { ScriptfileUtils . setExecutePermissions ( script ) ; } catch ( IOException e ) { log . warn ( "Unable to set executable bit for script file: " + script + ": " + e . getMessage ( ) ) ; } } debug ( "expanded plugin dir! " + fileExpandedDir ) ; } else { debug ( "expanded plugin dir: " + fileExpandedDir ) ; } if ( pluginDef . getPluginType ( ) . equals ( "script" ) ) { final File script = new File ( fileExpandedDir , pluginDef . getScriptFile ( ) ) ; if ( ! script . exists ( ) || ! script . isFile ( ) ) { throw new PluginException ( "Script file was not found: " + script . getAbsolutePath ( ) ) ; } } return new ScriptPluginProviderImpl ( pluginMeta , pluginDef , file , fileExpandedDir ) ; }
Get the ScriptPluginProvider definition from the file for the given provider def and ident