Ejemplo n.º 1
0
  private void loadAllNotes() throws IOException {
    List<NoteInfo> noteInfos = notebookRepo.list();

    for (NoteInfo info : noteInfos) {
      loadNoteFromRepo(info.getId());
    }
  }
Ejemplo n.º 2
0
 /**
  * Reload all notes from repository after clearing `notes` to reflect the changes of
  * added/deleted/modified notebooks on file system level.
  *
  * @return
  * @throws IOException
  */
 private void reloadAllNotes() throws IOException {
   synchronized (notes) {
     notes.clear();
   }
   List<NoteInfo> noteInfos = notebookRepo.list();
   for (NoteInfo info : noteInfos) {
     loadNoteFromRepo(info.getId());
   }
 }
Ejemplo n.º 3
0
  /**
   * Reload all notes from repository after clearing `notes` to reflect the changes of
   * added/deleted/modified notebooks on file system level.
   *
   * @throws IOException
   */
  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);
    }
  }