MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / installJarPlugins

Method installJarPlugins

ij/src/main/java/ij/Menus.java:771–802  ·  view source on GitHub ↗

Install plugins located in JAR files.

()

Source from the content-addressed store, hash-verified

769
770 /** Install plugins located in JAR files. */
771 @AstroImageJ(reason = "Auto generate plugins list while still defining extra plugins", modified = true)
772 void installJarPlugins() {
773 if (jarFiles==null)
774 return;
775 installingJars = true;
776 for (int i=0; i<jarFiles.size(); i++) {
777 isJarErrorHeading = false;
778 String jar = (String)jarFiles.elementAt(i);
779 InputStream is = getConfigurationFile(jar);
780 if (is==null) continue;
781 ArrayList entries = new ArrayList(20);
782 LineNumberReader lnr = new LineNumberReader(new InputStreamReader(is));
783 try {
784 while(true) {
785 String s = lnr.readLine();
786 if (s==null) break;
787 if (readExtraPlugins(s)) {
788 readExtraJarPlugins(jar, entries);
789 }
790 if (s.length()>=3 && !s.startsWith("#"))
791 entries.add(s);
792 }
793 }
794 catch (IOException e) {}
795 finally {
796 try {if (lnr!=null) lnr.close();}
797 catch (IOException e) {}
798 }
799 for (int j=0; j<entries.size(); j++)
800 installJarPlugin(jar, (String)entries.get(j));
801 }
802 }
803
804 @AstroImageJ(reason = "Auto generate plugins list while still defining extra plugins")
805 private void readExtraJarPlugins(String jar, List jarPlugins) {

Callers 1

installPluginsMethod · 0.95

Calls 11

getConfigurationFileMethod · 0.95
readExtraPluginsMethod · 0.95
readExtraJarPluginsMethod · 0.95
installJarPluginMethod · 0.95
startsWithMethod · 0.80
lengthMethod · 0.65
addMethod · 0.65
closeMethod · 0.65
sizeMethod · 0.45
readLineMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected