Changeset 1619 in josm for trunk/src/org
- Timestamp:
- 2009-05-24T18:35:56+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/plugins/PluginDownloader.java
r1591 r1619 9 9 10 10 import java.io.BufferedReader; 11 import java.io.BufferedWriter; 11 12 import java.io.File; 12 13 import java.io.FileNotFoundException; … … 18 19 import java.io.InputStreamReader; 19 20 import java.io.OutputStream; 21 import java.io.OutputStreamWriter; 20 22 import java.net.MalformedURLException; 21 23 import java.net.URL; … … 84 86 try { 85 87 BufferedReader r = new BufferedReader(new InputStreamReader(new URL(site).openStream(), "utf-8")); 86 StringBuilder b = new StringBuilder(); 88 new File(Main.pref.getPreferencesDir()+"plugins").mkdir(); 89 BufferedWriter out = new BufferedWriter(new OutputStreamWriter( 90 new FileOutputStream(new File(Main.pref.getPluginsDirFile(), 91 count + "-site-" + site.replaceAll("[/:\\\\ <>|]", "_") + ".txt")), "utf-8")); 87 92 for (String line = r.readLine(); line != null; line = r.readLine()) 88 b.append(line+"\n");93 out.append(line+"\n"); 89 94 r.close(); 90 new File(Main.pref.getPreferencesDir()+"plugins").mkdir();91 FileWriter out = new FileWriter(new File(Main.pref92 .getPluginsDirFile(), count + "-site-"93 + site.replaceAll("[/:\\\\ <>|]", "_") + ".txt"));94 out.append(b);95 95 out.close(); 96 96 count++;
Note:
See TracChangeset
for help on using the changeset viewer.