/** * Loads the given plugin and enables it for the given project. * * @param f * A non-null jar file of custom plugin. * @param project * A nullable target project */ public static Plugin loadCustomPlugin(File f, @CheckForNull Project project) throws PluginException { URL urlString; try { urlString = f.toURI().toURL(); } catch (MalformedURLException e) { throw new IllegalArgumentException(e); } return loadCustomPlugin(urlString, project); }
@Override protected void handleOptionWithArgument(String option, String argument) throws IOException { if ("-pluginList".equals(option)) { String pluginListStr = argument; Map<String, Boolean> customPlugins = getProject().getConfiguration().getCustomPlugins(); StringTokenizer tok = new StringTokenizer(pluginListStr, File.pathSeparator); while (tok.hasMoreTokens()) { File file = new File(tok.nextToken()); Boolean enabled = Boolean.valueOf(file.isFile()); customPlugins.put(file.getAbsolutePath(), enabled); if(enabled.booleanValue()) { try { Plugin.loadCustomPlugin(file, getProject()); } catch (PluginException e) { throw new IllegalStateException("Failed to load plugin " + "specified by the '-pluginList', file: " + file, e); } } } } else if ("-maxRank".equals(option)) { maxRank = Integer.parseInt(argument); } else if ("-summarizeMaxRank".equals(option)) { summarizeMaxRank = Integer.parseInt(argument); } else { throw new IllegalStateException(); } } }
@Override protected void handleOptionWithArgument(String option, String argument) throws IOException { if ("-home".equals(option)) { FindBugs.setHome(argument); } else if ("-pluginList".equals(option)) { String pluginListStr = argument; Map<String, Boolean> customPlugins = getProject().getConfiguration().getCustomPlugins(); StringTokenizer tok = new StringTokenizer(pluginListStr, File.pathSeparator); while (tok.hasMoreTokens()) { File file = new File(tok.nextToken()); Boolean enabled = Boolean.valueOf(file.isFile()); customPlugins.put(file.getAbsolutePath(), enabled); if(enabled.booleanValue()) { try { Plugin.loadCustomPlugin(file, getProject()); } catch (PluginException e) { throw new IllegalStateException("Failed to load plugin " + "specified by the '-pluginList', file: " + file, e); } } } } else if ("-project".equals(option)) { loadProject(argument); } else { throw new IllegalStateException(); } }
out.close(); loadedPlugin = Plugin.loadCustomPlugin(f.toURI().toURL(), project);
/** * Loads the given plugin and enables it for the given project. */ public static Plugin loadCustomPlugin(File f, @CheckForNull Project project) throws PluginException { URL urlString; try { urlString = f.toURI().toURL(); } catch (MalformedURLException e) { throw new IllegalArgumentException(e); } return loadCustomPlugin(urlString, project); }
@Override protected void handleOptionWithArgument(String option, String argument) throws IOException { if ("-pluginList".equals(option)) { String pluginListStr = argument; Map<String, Boolean> customPlugins = getProject().getConfiguration().getCustomPlugins(); StringTokenizer tok = new StringTokenizer(pluginListStr, File.pathSeparator); while (tok.hasMoreTokens()) { File file = new File(tok.nextToken()); Boolean enabled = Boolean.valueOf(file.isFile()); customPlugins.put(file.getAbsolutePath(), enabled); if(enabled.booleanValue()) { try { Plugin.loadCustomPlugin(file, getProject()); } catch (PluginException e) { throw new IllegalStateException("Failed to load plugin " + "specified by the '-pluginList', file: " + file, e); } } } } else if ("-maxRank".equals(option)) { maxRank = Integer.parseInt(argument); } else if ("-summarizeMaxRank".equals(option)) { summarizeMaxRank = Integer.parseInt(argument); } else { throw new IllegalStateException(); } } }
@Override protected void handleOptionWithArgument(String option, String argument) throws IOException { if ("-home".equals(option)) { FindBugs.setHome(argument); } else if ("-pluginList".equals(option)) { String pluginListStr = argument; Map<String, Boolean> customPlugins = getProject().getConfiguration().getCustomPlugins(); StringTokenizer tok = new StringTokenizer(pluginListStr, File.pathSeparator); while (tok.hasMoreTokens()) { File file = new File(tok.nextToken()); Boolean enabled = Boolean.valueOf(file.isFile()); customPlugins.put(file.getAbsolutePath(), enabled); if(enabled.booleanValue()) { try { Plugin.loadCustomPlugin(file, getProject()); } catch (PluginException e) { throw new IllegalStateException("Failed to load plugin " + "specified by the '-pluginList', file: " + file, e); } } } } else if ("-project".equals(option)) { loadProject(argument); } else { throw new IllegalStateException(); } }
try { Plugin plugin = Plugin.loadCustomPlugin(f, PreferencesFrame.this.getCurrentProject());
Wrap.project(args[0], args[1], args[2].split(",")); try { Plugin.loadCustomPlugin(new File(args[Tv.THREE]), project); } catch (final PluginException ex) { throw new IllegalStateException(ex);
Wrap.project(args[0], args[1], args[2].split(",")); try { Plugin.loadCustomPlugin(new File(args[Tv.THREE]), project); } catch (final PluginException ex) { throw new IllegalStateException(ex);