Notebook { public void reloadAllNotes(AuthenticationInfo subject) 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(subject); for (NoteInfo info : noteInfos) { loadNoteFromRepo(info.getId(), subject); } } Notebook(ZeppelinConfiguration conf, NotebookRepo notebookRepo,
      SchedulerFactory schedulerFactory,
      InterpreterFactory replFactory, JobListenerFactory jobListenerFactory,
      SearchService notebookIndex,
      NotebookAuthorization notebookAuthorization,
      Credentials credentials); Note createNote(AuthenticationInfo subject); Note createNote(List<String> interpreterIds, AuthenticationInfo subject); String exportNote(String noteId); Note importNote(String sourceJson, String noteName, AuthenticationInfo subject); Note cloneNote(String sourceNoteID, String newNoteName, AuthenticationInfo subject); 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, AuthenticationInfo subject); void checkpointNote(String noteId, String checkpointMessage, AuthenticationInfo subject); void reloadAllNotes(AuthenticationInfo subject); List<Note> getAllNotes(); JobListenerFactory getJobListenerFactory(); void setJobListenerFactory(JobListenerFactory jobListenerFactory); List<Map<String, Object>> getJobListforNotebook(boolean needsReload,
      long lastUpdateServerUnixTime, AuthenticationInfo subject); void refreshCron(String id); InterpreterFactory getInterpreterFactory(); NotebookAuthorization getNotebookAuthorization(); 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) { logger.error(e.toString(), e); } List<Note> notes = notebook.getAllNotes(); assertEquals(notes.size(), 0); Note copiedNote = notebookRepo.get("2A94M5J1Z", null); notebook.reloadAllNotes(null); 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(null); notes = notebook.getAllNotes(); assertEquals(notes.size(), 0); }