1515import seedu .address .commons .util .StringUtil ;
1616import seedu .address .logic .Logic ;
1717import seedu .address .logic .LogicManager ;
18- import seedu .address .model .InternshipDiary ;
18+ import seedu .address .model .AddressBook ;
1919import seedu .address .model .Model ;
2020import seedu .address .model .ModelManager ;
21- import seedu .address .model .ReadOnlyInternshipDiary ;
21+ import seedu .address .model .ReadOnlyAddressBook ;
2222import seedu .address .model .ReadOnlyUserPrefs ;
2323import seedu .address .model .UserPrefs ;
2424import seedu .address .model .util .SampleDataUtil ;
25- import seedu .address .storage .InternshipDiaryStorage ;
26- import seedu .address .storage .JsonInternshipDiaryStorage ;
25+ import seedu .address .storage .AddressBookStorage ;
26+ import seedu .address .storage .JsonAddressBookStorage ;
2727import seedu .address .storage .JsonUserPrefsStorage ;
2828import seedu .address .storage .Storage ;
2929import seedu .address .storage .StorageManager ;
@@ -48,17 +48,16 @@ public class MainApp extends Application {
4848
4949 @ Override
5050 public void init () throws Exception {
51- logger .info ("=============================[ Initializing InternshipDiary ]===========================" );
51+ logger .info ("=============================[ Initializing AddressBook ]===========================" );
5252 super .init ();
5353
5454 AppParameters appParameters = AppParameters .parse (getParameters ());
5555 config = initConfig (appParameters .getConfigPath ());
5656
5757 UserPrefsStorage userPrefsStorage = new JsonUserPrefsStorage (config .getUserPrefsFilePath ());
5858 UserPrefs userPrefs = initPrefs (userPrefsStorage );
59- InternshipDiaryStorage internshipDiaryStorage =
60- new JsonInternshipDiaryStorage (userPrefs .getInternshipDiaryFilePath ());
61- storage = new StorageManager (internshipDiaryStorage , userPrefsStorage );
59+ AddressBookStorage addressBookStorage = new JsonAddressBookStorage (userPrefs .getAddressBookFilePath ());
60+ storage = new StorageManager (addressBookStorage , userPrefsStorage );
6261
6362 initLogging (config );
6463
@@ -75,20 +74,20 @@ public void init() throws Exception {
7574 * or an empty address book will be used instead if errors occur when reading {@code storage}'s address book.
7675 */
7776 private Model initModelManager (Storage storage , ReadOnlyUserPrefs userPrefs ) {
78- Optional <ReadOnlyInternshipDiary > internshipDiaryOptional ;
79- ReadOnlyInternshipDiary initialData ;
77+ Optional <ReadOnlyAddressBook > addressBookOptional ;
78+ ReadOnlyAddressBook initialData ;
8079 try {
81- internshipDiaryOptional = storage .readInternshipDiary ();
82- if (!internshipDiaryOptional .isPresent ()) {
83- logger .info ("Data file not found. Will be starting with a sample InternshipDiary " );
80+ addressBookOptional = storage .readAddressBook ();
81+ if (!addressBookOptional .isPresent ()) {
82+ logger .info ("Data file not found. Will be starting with a sample AddressBook " );
8483 }
85- initialData = internshipDiaryOptional .orElseGet (SampleDataUtil ::getSampleInternshipDiary );
84+ initialData = addressBookOptional .orElseGet (SampleDataUtil ::getSampleAddressBook );
8685 } catch (DataConversionException e ) {
87- logger .warning ("Data file not in the correct format. Will be starting with an empty InternshipDiary " );
88- initialData = new InternshipDiary ();
86+ logger .warning ("Data file not in the correct format. Will be starting with an empty AddressBook " );
87+ initialData = new AddressBook ();
8988 } catch (IOException e ) {
90- logger .warning ("Problem while reading from the file. Will be starting with an empty InternshipDiary " );
91- initialData = new InternshipDiary ();
89+ logger .warning ("Problem while reading from the file. Will be starting with an empty AddressBook " );
90+ initialData = new AddressBook ();
9291 }
9392
9493 return new ModelManager (initialData , userPrefs );
@@ -152,7 +151,7 @@ protected UserPrefs initPrefs(UserPrefsStorage storage) {
152151 + "Using default user prefs" );
153152 initializedPrefs = new UserPrefs ();
154153 } catch (IOException e ) {
155- logger .warning ("Problem while reading from the file. Will be starting with an empty InternshipDiary " );
154+ logger .warning ("Problem while reading from the file. Will be starting with an empty AddressBook " );
156155 initializedPrefs = new UserPrefs ();
157156 }
158157
@@ -168,13 +167,13 @@ protected UserPrefs initPrefs(UserPrefsStorage storage) {
168167
169168 @ Override
170169 public void start (Stage primaryStage ) {
171- logger .info ("Starting InternshipDiary " + MainApp .VERSION );
170+ logger .info ("Starting AddressBook " + MainApp .VERSION );
172171 ui .start (primaryStage );
173172 }
174173
175174 @ Override
176175 public void stop () {
177- logger .info ("============================ [ Stopping InternshipDiary ] =============================" );
176+ logger .info ("============================ [ Stopping Address Book ] =============================" );
178177 try {
179178 storage .saveUserPrefs (model .getUserPrefs ());
180179 } catch (IOException e ) {
0 commit comments