Package org.java.plugin.util

Examples of org.java.plugin.util.ExtendedProperties


        /*
         * Now find plug-ins! Check directories and jar.
         */
        try {
            DefaultPluginsCollector collector = new DefaultPluginsCollector();
            ExtendedProperties ep = new ExtendedProperties();


            List<File> directoriesToSearch = new LinkedList<File>();
            directoriesToSearch.add(new File("./src/plugins"));
            directoriesToSearch.add(new File("./plugins"));
            directoriesToSearch.add(userPluginDir);

            try {
                File parent = new File(PluginCore.class.getProtectionDomain()
                    .getCodeSource().getLocation().toURI()).getParentFile();
           
                if (!parent.getCanonicalFile().equals(
                    new File(".").getCanonicalFile())) {
                    directoriesToSearch.add(new File(parent, "/src/plugins"));
                    directoriesToSearch.add(new File(parent, "/plugins"));
                }
            } catch (Exception e) {
                // no problem, we just use paths relative to current dir.
            }

            StringBuilder sb = new StringBuilder();
            for (File directory : directoriesToSearch) {
                // We don't want warnings if the default plug-in paths don't
                // exist, we do that below
                if (directory.exists()) {
                    if (sb.length() > 0)
                        sb.append(',');
                    sb.append(directory.getPath());
                }
            }

            ep.setProperty("org.java.plugin.boot.pluginsRepositories", sb
                .toString());
            collector.configure(ep);

            Collection<PluginLocation> plugins = collector
                .collectPluginLocations();
View Full Code Here


    if (!pluginsRoot.exists()) {
      pluginsRoot.mkdirs();
    }

    // configure initial properties
    ExtendedProperties props = new ExtendedProperties(System.getProperties());
        props.put("org.java.plugin.PathResolver", "org.java.plugin.standard.ShadingPathResolver");
        props.put("org.java.plugin.standard.ShadingPathResolver.shadowFolder", "temp/.jpf-shadow");
        props.put("org.java.plugin.standard.ShadingPathResolver.unpackMode", "smart");
        props.put("org.java.plugin.standard.PluginLifecycleHandler", "org.mokai.plugin.jpf.CustomPluginLifecycleHandler");

    // instanciamos el plugin manager
    pluginManager = ObjectFactory.newInstance(props).createManager();

    File[] pluginsFolders = pluginsRoot.listFiles();
View Full Code Here

TOP

Related Classes of org.java.plugin.util.ExtendedProperties

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.