Changeset 30738 in osm for applications/editors/josm/plugins/ext_tools/src
- Timestamp:
- 2014-10-19T01:27:04+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/ext_tools/src/ext_tools/ToolsInformation.java
r30737 r30738 8 8 import java.util.ArrayList; 9 9 import java.util.List; 10 11 import org.openstreetmap.josm.Main; 10 12 11 13 public class ToolsInformation { … … 20 22 21 23 public void load() { 22 try { 23 BufferedReader rdr = new BufferedReader(new InputStreamReader( 24 new FileInputStream(filename), "UTF-8")); 24 try (BufferedReader rdr = new BufferedReader(new InputStreamReader( 25 new FileInputStream(filename), "UTF-8"))) { 25 26 StringBuilder sb = new StringBuilder(); 26 27 String line; … … 32 33 } 33 34 } 34 rdr.close();35 35 } catch (Exception e) { 36 System.err.println("Ext_Tools warning: can not load file "+filename); 37 // e.printStackTrace(); 36 Main.warn("Ext_Tools warning: can not load file "+filename); 38 37 } 39 38 } 40 39 41 40 public void save() { 42 try { 43 OutputStreamWriter w = new OutputStreamWriter(new FileOutputStream(filename), 44 "UTF-8"); 41 try (OutputStreamWriter w = new OutputStreamWriter(new FileOutputStream(filename), "UTF-8")) { 45 42 for (ExtTool tool : tools) 46 43 w.write(tool.serialize()); 47 w.close();48 44 } catch (Exception e) { 49 System.err.println("Ext_Tools warning: can not save file "+filename); 50 // e.printStackTrace(); 45 Main.warn("Ext_Tools warning: can not save file "+filename); 51 46 } 52 47 }
Note:
See TracChangeset
for help on using the changeset viewer.