Esempio n. 1
0
 @Override
 public void save() {
   FileOutputStream stream = null;
   try {
     stream = new FileOutputStream(this.fileName);
     this.properties.store(stream, "Citizens File");
   } catch (IOException ex) {
     Messaging.log("Unable to save " + this.fileName, Level.SEVERE);
   } finally {
     try {
       if (stream != null) {
         Messaging.debug("Save stream closed.");
         stream.close();
       }
     } catch (IOException e) {
       Messaging.log("Unable to close " + this.fileName, Level.SEVERE);
     }
   }
 }
Esempio n. 2
0
 @Override
 public void load() {
   FileInputStream stream = null;
   try {
     stream = new FileInputStream(this.fileName);
     this.properties.load(stream);
   } catch (IOException ex) {
     Messaging.log("Unable to load " + this.fileName, Level.SEVERE);
   } finally {
     try {
       if (stream != null) {
         Messaging.debug("Load stream closed.");
         stream.close();
       }
     } catch (IOException e) {
       Messaging.log("Unable to close " + this.fileName, Level.SEVERE);
     }
   }
 }