Install plugins located in JAR files.
()
| 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) { |
no test coverage detected