auto-sync

This commit is contained in:
rusEfi 2015-01-27 08:04:17 -06:00
parent e3ab55dc65
commit d09f85b1e8
1 changed files with 2 additions and 3 deletions

View File

@ -2,7 +2,6 @@ package com.rusefi.ui.storage;
import com.irnems.FileLog;
import javax.swing.*;
import java.beans.XMLDecoder;
import java.beans.XMLEncoder;
import java.io.*;
@ -19,6 +18,7 @@ public class PersistentConfiguration {
return INSTANCE;
}
@SuppressWarnings("unchecked")
public void load() {
try {
XMLDecoder e = new XMLDecoder(new BufferedInputStream(new FileInputStream(CONFIG_FILE_NAME)));
@ -30,9 +30,8 @@ public class PersistentConfiguration {
}
public void save() {
XMLEncoder e = null;
try {
e = new XMLEncoder(new BufferedOutputStream(new FileOutputStream(CONFIG_FILE_NAME)));
XMLEncoder e = new XMLEncoder(new BufferedOutputStream(new FileOutputStream(CONFIG_FILE_NAME)));
e.writeObject(config);
e.close();
System.out.println("Saved to " + CONFIG_FILE_NAME);