Ultimato il sistema di restore del contatore oggetti inseriti id
This commit is contained in:
@@ -23,7 +23,19 @@ public class IdCounter {
|
||||
}
|
||||
|
||||
|
||||
public static void restore_counter() throws FileNotFoundException,IOException,ClassNotFoundException{
|
||||
File f_data = new File("id_counter");
|
||||
if ( (f_data.exists())){
|
||||
ObjectInputStream reader = new ObjectInputStream(new FileInputStream(f_data));
|
||||
Integer data = (Integer) reader.readObject();
|
||||
Global.setGeneral_counter(data.intValue());
|
||||
}else{
|
||||
|
||||
Global.setGeneral_counter(0);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user