Notebook { public void reloadAllNotes() throws IOException { synchronized (notes) { notes.clear(); } if (notebookRepo instanceof NotebookRepoSync) { NotebookRepoSync mainRepo = (NotebookRepoSync) notebookRepo; if (mainRepo.getRepoCount() > 1) { mainRepo.sync(); } } List<NoteInfo> noteInfos = notebookRepo.list(); for (NoteInfo info : noteInfos) { loadNoteFromRepo(info.getId()); } } Notebook(ZeppelinConfiguration conf, NotebookRepo notebookRepo,
      SchedulerFactory schedulerFactory,
      InterpreterFactory replFactory, JobListenerFactory jobListenerFactory,
      SearchService notebookIndex); Note createNote(); Note createNote(List<String> interpreterIds); Note cloneNote(String sourceNoteID, String newNoteName); void bindInterpretersToNote(String id,
      List<String> interpreterSettingIds); List<String> getBindedInterpreterSettingsIds(String id); List<InterpreterSetting> getBindedInterpreterSettings(String id); Note getNote(String id); void removeNote(String id); void reloadAllNotes(); List<Note> getAllNotes(); JobListenerFactory getJobListenerFactory(); void setJobListenerFactory(JobListenerFactory jobListenerFactory); void refreshCron(String id); InterpreterFactory getInterpreterFactory(); ZeppelinConfiguration getConf(); void close();  }
@Test public void testReloadAllNotes() throws IOException { File srcDir = new File("src/test/resources/2A94M5J1Z"); File destDir = new File(notebookDir.getAbsolutePath() + "/2A94M5J1Z"); try { FileUtils.copyDirectory(srcDir, destDir); } catch (IOException e) { e.printStackTrace(); } List<Note> notes = notebook.getAllNotes(); assertEquals(notes.size(), 0); Note copiedNote = notebookRepo.get("2A94M5J1Z"); notebook.reloadAllNotes(); notes = notebook.getAllNotes(); assertEquals(notes.size(), 1); assertEquals(notes.get(0).id(), copiedNote.id()); assertEquals(notes.get(0).getName(), copiedNote.getName()); assertEquals(notes.get(0).getParagraphs(), copiedNote.getParagraphs()); FileUtils.deleteDirectory(destDir); notes = notebook.getAllNotes(); assertEquals(notes.size(), 1); notebook.reloadAllNotes(); notes = notebook.getAllNotes(); assertEquals(notes.size(), 0); }