public static @CheckForNull Plugin addCustomPlugin(URL u) throws PluginException { return addCustomPlugin(u, PluginLoader.class.getClassLoader()); }
public static @CheckForNull Plugin addCustomPlugin(URI u) throws PluginException { return addCustomPlugin(u, PluginLoader.class.getClassLoader()); }
public static @CheckForNull Plugin addCustomPlugin(URI u, ClassLoader parent) throws PluginException { URL url; try { url = u.toURL(); } catch (MalformedURLException e) { throw new PluginException("Unable to convert uri to url:" + u, e); } return addCustomPlugin(url, parent); }
/** * Loads the given plugin and enables it for the given project. */ public static Plugin loadCustomPlugin(URL urlString, @CheckForNull Project project) throws PluginException { Plugin plugin = addCustomPlugin(urlString); if (project != null) { project.setPluginStatusTrinary(plugin.getPluginId(), true); } return plugin; }
@CheckReturnValue private Project createProject(Path[] files) { final Project project = new Project(); project.setProjectName(getClass().getSimpleName()); if (PLUGIN_JAR != null) { try { String pluginId = Plugin.addCustomPlugin(PLUGIN_JAR.toURI()).getPluginId(); project.setPluginStatusTrinary(pluginId, Boolean.TRUE); } catch (PluginException e) { throw new AssertionError("Failed to load plugin", e); } } for (Path file : files) { project.addFile(file.toAbsolutePath().toString()); } for (Path auxClasspathEntry : auxClasspathEntries) { project.addAuxClasspathEntry(auxClasspathEntry.toAbsolutePath().toString()); } return project; }
public static @CheckForNull Plugin addCustomPlugin(URI u) throws PluginException { return addCustomPlugin(u, PluginLoader.class.getClassLoader()); }
public static @CheckForNull Plugin addCustomPlugin(URL u) throws PluginException { return addCustomPlugin(u, PluginLoader.class.getClassLoader()); }
public static @CheckForNull Plugin addCustomPlugin(URI u, ClassLoader parent) throws PluginException { URL url; try { url = u.toURL(); } catch (MalformedURLException e) { throw new PluginException("Unable to convert uri to url:" + u, e); } return addCustomPlugin(url, parent); }
/** * Loads the given plugin and enables it for the given project. */ public static Plugin loadCustomPlugin(URL urlString, @CheckForNull Project project) throws PluginException { Plugin plugin = addCustomPlugin(urlString); if (project != null) { project.setPluginStatusTrinary(plugin.getPluginId(), true); } return plugin; }
private static List<Plugin> loadPlugins() { final List<Plugin> res = new ArrayList<>(); final Enumeration<URL> resources = findPluginUrls(); while (resources.hasMoreElements()) { try { final Plugin plugin = Plugin.addCustomPlugin(jarUrl(resources.nextElement())); if (plugin != null) { res.add(plugin); LOG.info("Loaded plugin {}", plugin.getPluginId()); } } catch (DuplicatePluginIdException e) { //ignore } catch (MalformedURLException | PluginException e) { LOG.warn("Problem loading plugin", e); } } return res; }
private static List<Plugin> loadPlugins() { final List<Plugin> res = new ArrayList<>(); final Enumeration<URL> resources = findPluginUrls(); while (resources.hasMoreElements()) { try { final Plugin plugin = Plugin.addCustomPlugin(jarUrl(resources.nextElement())); if (plugin != null) { res.add(plugin); LOG.info("Loaded plugin {}", plugin.getPluginId()); } } catch (DuplicatePluginIdException e) { //ignore } catch (MalformedURLException | PluginException e) { LOG.warn("Problem loading plugin", e); } } return res; }
Plugin plugin = Plugin.addCustomPlugin(new File(path).toURI(), contextClassLoader); if (plugin != null) { customPluginList.add(plugin);
try { URI u = new URI(s); Plugin.addCustomPlugin(u); newInstance.customPlugins.add(u); } catch (PluginException e) {