1515import seedu .address .commons .util .StringUtil ;
1616import seedu .address .logic .Logic ;
1717import seedu .address .logic .LogicManager ;
18- import seedu .address .model .AddressBook ;
18+ import seedu .address .model .InternshipDiary ;
1919import seedu .address .model .Model ;
2020import seedu .address .model .ModelManager ;
21- import seedu .address .model .ReadOnlyAddressBook ;
21+ import seedu .address .model .ReadOnlyInternshipDiary ;
2222import seedu .address .model .ReadOnlyUserPrefs ;
2323import seedu .address .model .UserPrefs ;
2424import seedu .address .model .util .SampleDataUtil ;
25- import seedu .address .storage .AddressBookStorage ;
26- import seedu .address .storage .JsonAddressBookStorage ;
25+ import seedu .address .storage .InternshipDiaryStorage ;
26+ import seedu .address .storage .JsonInternshipDiaryStorage ;
2727import seedu .address .storage .JsonUserPrefsStorage ;
2828import seedu .address .storage .Storage ;
2929import seedu .address .storage .StorageManager ;
@@ -48,16 +48,17 @@ public class MainApp extends Application {
4848
4949 @ Override
5050 public void init () throws Exception {
51- logger .info ("=============================[ Initializing AddressBook ]===========================" );
51+ logger .info ("=============================[ Initializing InternshipDiary ]===========================" );
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- AddressBookStorage addressBookStorage = new JsonAddressBookStorage (userPrefs .getAddressBookFilePath ());
60- storage = new StorageManager (addressBookStorage , userPrefsStorage );
59+ InternshipDiaryStorage internshipDiaryStorage =
60+ new JsonInternshipDiaryStorage (userPrefs .getInternshipDiaryFilePath ());
61+ storage = new StorageManager (internshipDiaryStorage , userPrefsStorage );
6162
6263 initLogging (config );
6364
@@ -74,20 +75,20 @@ public void init() throws Exception {
7475 * or an empty address book will be used instead if errors occur when reading {@code storage}'s address book.
7576 */
7677 private Model initModelManager (Storage storage , ReadOnlyUserPrefs userPrefs ) {
77- Optional <ReadOnlyAddressBook > addressBookOptional ;
78- ReadOnlyAddressBook initialData ;
78+ Optional <ReadOnlyInternshipDiary > internshipDiaryOptional ;
79+ ReadOnlyInternshipDiary initialData ;
7980 try {
80- addressBookOptional = storage .readAddressBook ();
81- if (!addressBookOptional .isPresent ()) {
82- logger .info ("Data file not found. Will be starting with a sample AddressBook " );
81+ internshipDiaryOptional = storage .readInternshipDiary ();
82+ if (!internshipDiaryOptional .isPresent ()) {
83+ logger .info ("Data file not found. Will be starting with a sample InternshipDiary " );
8384 }
84- initialData = addressBookOptional .orElseGet (SampleDataUtil ::getSampleAddressBook );
85+ initialData = internshipDiaryOptional .orElseGet (SampleDataUtil ::getSampleInternshipDiary );
8586 } catch (DataConversionException e ) {
86- logger .warning ("Data file not in the correct format. Will be starting with an empty AddressBook " );
87- initialData = new AddressBook ();
87+ logger .warning ("Data file not in the correct format. Will be starting with an empty InternshipDiary " );
88+ initialData = new InternshipDiary ();
8889 } catch (IOException e ) {
89- logger .warning ("Problem while reading from the file. Will be starting with an empty AddressBook " );
90- initialData = new AddressBook ();
90+ logger .warning ("Problem while reading from the file. Will be starting with an empty InternshipDiary " );
91+ initialData = new InternshipDiary ();
9192 }
9293
9394 return new ModelManager (initialData , userPrefs );
@@ -151,7 +152,7 @@ protected UserPrefs initPrefs(UserPrefsStorage storage) {
151152 + "Using default user prefs" );
152153 initializedPrefs = new UserPrefs ();
153154 } catch (IOException e ) {
154- logger .warning ("Problem while reading from the file. Will be starting with an empty AddressBook " );
155+ logger .warning ("Problem while reading from the file. Will be starting with an empty InternshipDiary " );
155156 initializedPrefs = new UserPrefs ();
156157 }
157158
@@ -167,13 +168,13 @@ protected UserPrefs initPrefs(UserPrefsStorage storage) {
167168
168169 @ Override
169170 public void start (Stage primaryStage ) {
170- logger .info ("Starting AddressBook " + MainApp .VERSION );
171+ logger .info ("Starting InternshipDiary " + MainApp .VERSION );
171172 ui .start (primaryStage );
172173 }
173174
174175 @ Override
175176 public void stop () {
176- logger .info ("============================ [ Stopping Address Book ] =============================" );
177+ logger .info ("============================ [ Stopping InternshipDiary ] =============================" );
177178 try {
178179 storage .saveUserPrefs (model .getUserPrefs ());
179180 } catch (IOException e ) {
0 commit comments