Changeset 2554 in josm for trunk/src/org
- Timestamp:
- 2009-11-30T13:48:36+01:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/plugins
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/plugins/PluginDownloader.java
r2542 r2554 106 106 public static int downloadDescription() { 107 107 int count = 0; 108 LinkedList<String> sitenames = new LinkedList<String>(); 108 109 for (String site : getSites()) { 109 /* TODO: remove old site files (everything except .jar) */110 110 try { 111 String filesite = site.replaceAll("%<(.*)>", ""); 111 112 /* replace %<x> with empty string or x=plugins (separated with comma) */ 112 113 String pl = Main.pref.getCollectionAsString("plugins"); … … 114 115 site = site.replaceAll("%<(.*)>", "$1"+pl); 115 116 else 116 site = site.replaceAll("%<(.*)>", "");117 site = filesite; 117 118 BufferedReader r = new BufferedReader(new InputStreamReader(new URL(site).openStream(), "utf-8")); 118 119 new File(Main.pref.getPreferencesDir()+"plugins").mkdir(); 120 String sname = count + "-site-" + filesite.replaceAll("[/:\\\\ <>|]", "_") + ".txt"; 121 sitenames.add(sname); 119 122 BufferedWriter out = new BufferedWriter(new OutputStreamWriter( 120 new FileOutputStream(new File(Main.pref.getPluginsDirFile(), 121 count + "-site-" + site.replaceAll("[/:\\\\ <>|]", "_") + ".txt")), "utf-8")); 123 new FileOutputStream(new File(Main.pref.getPluginsDirFile(), sname)), "utf-8")); 122 124 for (String line = r.readLine(); line != null; line = r.readLine()) { 123 125 out.append(line+"\n"); … … 127 129 count++; 128 130 } catch (IOException x) { 131 } 132 } 133 /* remove old files */ 134 File[] pluginFiles = Main.pref.getPluginsDirFile().listFiles(); 135 if (pluginFiles != null) { 136 for (File f : pluginFiles) { 137 if (!f.isFile()) 138 continue; 139 String fname = f.getName(); 140 if(fname.endsWith(".jar")) 141 { 142 for(String s : PluginHandler.oldplugins) 143 { 144 if(fname.equals(s+".jar")) 145 { 146 System.out.println(tr("Delete old plugin {0}",fname)); 147 f.delete(); 148 } 149 } 150 } 151 else if(!fname.endsWith(".jar.new") && !sitenames.contains(fname)) 152 { 153 System.out.println(tr("Delete old plugin file {0}",fname)); 154 } 129 155 } 130 156 } -
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r2542 r2554 42 42 public class PluginHandler { 43 43 44 public static String [] oldplugins = new String[] {"mappaint", "unglueplugin", 45 "lang-de", "lang-en_GB", "lang-fr", "lang-it", "lang-pl", "lang-ro", 46 "lang-ru", "ewmsplugin", "ywms", "tways-0.2", "geotagged", "landsat", 47 "namefinder", "waypoints", "slippy_map_chooser", "tcx-support", "usertools"}; 48 public static String [] unmaintained = new String[] {"gpsbabelgui", "Intersect_way"}; 49 44 50 /** 45 51 * All installed and loaded plugins (resp. their main classes) … … 59 65 plugins.addAll(Arrays.asList(System.getProperty("josm.plugins").split(","))); 60 66 } 61 62 String [] oldplugins = new String[] {"mappaint", "unglueplugin",63 "lang-de", "lang-en_GB", "lang-fr", "lang-it", "lang-pl", "lang-ro",64 "lang-ru", "ewmsplugin", "ywms", "tways-0.2", "geotagged", "landsat",65 "namefinder", "waypoints", "slippy_map_chooser", "tcx-support", "usertools"};66 String [] unmaintained = new String[] {"gpsbabelgui", "Intersect_way"};67 67 68 68 for (String p : oldplugins) {
Note:
See TracChangeset
for help on using the changeset viewer.