Package com.dtolabs.rundeck.core.plugins.metadata

Examples of com.dtolabs.rundeck.core.plugins.metadata.PluginMeta


    }

    public boolean isValidPluginFile(final File file) {
        try {
            final ZipInputStream zipinput = new ZipInputStream(new FileInputStream(file));
            final PluginMeta metadata = ScriptPluginProviderLoader.loadMeta(file, zipinput);
            zipinput.close();
            boolean valid = false;
            if(null!=metadata) {
                valid = ScriptPluginProviderLoader.validatePluginMeta(metadata, file);
            }
View Full Code Here


    /**
     * Return true if the plugin file can loade a provider for the ident
     */
    public synchronized boolean isLoaderFor(final ProviderIdent ident) {

        final PluginMeta pluginMeta;
        try {
            pluginMeta = getPluginMeta();
        } catch (IOException e) {
            log.warn("Unable to load file meta: " + e.getMessage());
            return false;
        }
        if (null == pluginMeta) {
            return false;
        }
        for (final ProviderDef pluginDef : pluginMeta.getPluginDefs()) {
            if (matchesProvider(ident, pluginDef)) {
                return true;
            }
        }
        return false;
View Full Code Here

        return false;
    }

    public List<ProviderIdent> listProviders() {
        final ArrayList<ProviderIdent> providerIdents = new ArrayList<ProviderIdent>();
        PluginMeta pluginMeta=null;
        try {
            pluginMeta = getPluginMeta();
        } catch (IOException e) {
            debug("Unable to load file meta: " + e.getMessage());
        }
        if (null == pluginMeta) {
            return providerIdents;
        }
        for (final ProviderDef pluginDef : pluginMeta.getPluginDefs()) {
            providerIdents.add(new ProviderIdent(pluginDef.getService(), pluginDef.getName()));
        }
        return providerIdents;
    }
View Full Code Here

     */
    static PluginMeta loadMeta(final File jar) throws IOException {
        FileInputStream fileInputStream = new FileInputStream(jar);
        try{
            final ZipInputStream zipinput = new ZipInputStream(fileInputStream);
            final PluginMeta metadata = ScriptPluginProviderLoader.loadMeta(jar, zipinput);
            return metadata;
        }finally {
            fileInputStream.close();
        }
    }
View Full Code Here

     * @param zipinput zip input stream
     * @return loaded metadata, or null if it is invalid or not found
     */
    static PluginMeta loadMeta(final File jar, final ZipInputStream zipinput) throws IOException {
        final String basename = basename(jar);
        PluginMeta metadata = null;
        boolean topfound = false;
        boolean found = false;
        boolean dirfound = false;
        ZipEntry nextEntry = zipinput.getNextEntry();
        while (null != nextEntry) {
View Full Code Here

     * @param file
     * @return version string
     */
    static String getVersionForFile(final File file)  {
        try {
            final PluginMeta pluginMeta = loadMeta(file);
            return pluginMeta.getVersion();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }
View Full Code Here

        }
        final ProviderIdent ident = new ProviderIdent(service.getName(), providerName);

        if (null == pluginProviderDefs.get(ident)) {
            //look for plugin def
            final PluginMeta pluginMeta;
            try {
                pluginMeta = getPluginMeta();
            } catch (IOException e) {
                throw new ProviderLoaderException(e, service.getName(), providerName);
            }
            if (null == pluginMeta) {
                throw new ProviderLoaderException("Unable to load plugin metadata for file: " + file, service.getName(),
                    providerName);
            }
            for (final ProviderDef pluginDef : pluginMeta.getPluginDefs()) {
                if (matchesProvider(ident, pluginDef)) {
                    final ScriptPluginProvider provider;
                    try {
                        provider = getPlugin(file, pluginDef, ident);
                    } catch (PluginException e) {
View Full Code Here

TOP

Related Classes of com.dtolabs.rundeck.core.plugins.metadata.PluginMeta

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.