Changeset 1591 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2009-05-15T09:38:39+02:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/plugins
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/plugins/PluginDownloader.java
r1588 r1591 83 83 /* TODO: remove old site files (everything except .jar) */ 84 84 try { 85 BufferedReader r = new BufferedReader(new InputStreamReader(new URL(site).openStream() ));85 BufferedReader r = new BufferedReader(new InputStreamReader(new URL(site).openStream(), "utf-8")); 86 86 StringBuilder b = new StringBuilder(); 87 87 for (String line = r.readLine(); line != null; line = r.readLine()) -
trunk/src/org/openstreetmap/josm/plugins/PluginSelection.java
r1588 r1591 13 13 import java.io.ByteArrayInputStream; 14 14 import java.io.File; 15 import java.io.FileReader; 15 import java.io.FileInputStream; 16 import java.io.InputStreamReader; 16 17 import java.io.IOException; 17 18 import java.util.Arrays; … … 270 271 } 271 272 } else if (fname.matches("^[0-9]+-site.*\\.txt$")) { 273 int err = 0; 272 274 try { 273 BufferedReader r = new BufferedReader(new FileReader(f));275 BufferedReader r = new BufferedReader(new InputStreamReader(new FileInputStream(f), "utf-8")); 274 276 String name = null; 275 277 String url = null; … … 291 293 if(name != null) 292 294 { 293 PluginInformation info = new PluginInformation(null, name.substring(0,name.length()-4), 294 new ByteArrayInputStream(manifest.getBytes())); 295 info.downloadlink = url; 296 if(!availablePlugins.containsKey(info.name)) 297 availablePlugins.put(info.name, info); 298 manifest = null; 295 try 296 { 297 PluginInformation info = new PluginInformation(null, name.substring(0,name.length()-4), 298 new ByteArrayInputStream(manifest.getBytes())); 299 info.downloadlink = url; 300 if(!availablePlugins.containsKey(info.name)) 301 availablePlugins.put(info.name, info); 302 } 303 catch (Exception e) 304 { 305 e.printStackTrace(); 306 ++err; 307 } 299 308 } 300 309 String x[] = line.split(";"); 301 310 name = x[0]; 302 311 url = x[1]; 312 manifest = null; 303 313 } 304 314 } … … 314 324 } catch (Exception e) { 315 325 e.printStackTrace(); 316 JOptionPane.showMessageDialog(Main.parent, tr("Error reading plugin information file: {0}", f.getName())); 326 ++err; 327 } 328 if(err > 0) 329 { 330 JOptionPane.showMessageDialog(Main.parent, tr("Error reading plugin information file: {0}", f.getName())); 317 331 } 318 332 }
Note:
See TracChangeset
for help on using the changeset viewer.