Changeset 30738 in osm for applications/editors/josm/plugins/globalsat/src
- Timestamp:
- 2014-10-19T01:27:04+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/globalsat/src/org/kaintoch/gps/globalsat/dg100/Dg100Config.java
r29854 r30738 11 11 import java.nio.ByteBuffer; 12 12 import java.util.Properties; 13 14 import org.openstreetmap.josm.Main; 13 15 14 16 /** … … 107 109 } 108 110 109 public String toString() 111 @Override 112 public String toString() 110 113 { 111 114 return … … 459 462 props.setProperty(propUnk3, "" + unk3); 460 463 props.setProperty(propUnk4, "" + unk4); 461 OutputStream os = null; 462 try 463 { 464 os = new FileOutputStream(fName); 464 465 try (OutputStream os = new FileOutputStream(fName)) { 465 466 props.store(os, "dg100 config"); 466 } 467 catch (Exception ex) 468 { 469 ex.printStackTrace(); 467 } catch (Exception ex) { 468 Main.error(ex); 470 469 throw ex; 471 470 } 472 finally 473 { 474 if (os != null) {os.close();} 475 } 476 } 477 478 public void readProps(String fName) 479 throws Exception 480 { 471 } 472 473 public void readProps(String fName) throws Exception { 481 474 Properties props = new Properties(); 482 InputStream is = null; 483 try 484 { 485 is = new FileInputStream(fName); 475 476 try (InputStream is = new FileInputStream(fName)) { 486 477 props.load(is); 487 } 488 catch (Exception ex) 489 { 490 ex.printStackTrace(); 478 } catch (Exception ex) { 479 Main.error(ex);; 491 480 throw ex; 492 }493 finally494 {495 if (is != null) {is.close();}496 481 } 497 482 logFormat = Byte.parseByte(props.getProperty(propLogFormat, "2"));
Note:
See TracChangeset
for help on using the changeset viewer.