use of org.apache.zeppelin.notebook.NoteManager.NoteNode in project zeppelin by apache.
the class Notebook method restoreAll.
public void restoreAll(AuthenticationInfo subject) throws IOException {
NoteManager.Folder trash = noteManager.getTrashFolder();
// restore notes under trash folder
// If the value changes in the loop, a concurrent modification exception is thrown.
// Collector implementation of collect methods to maintain immutability.
List<NoteNode> notes = trash.getNotes().values().stream().collect(Collectors.toList());
for (NoteManager.NoteNode noteNode : notes) {
moveNote(noteNode.getNoteId(), noteNode.getNotePath().replace("/~Trash", ""), subject);
}
// restore folders under trash folder
List<Folder> folders = trash.getFolders().values().stream().collect(Collectors.toList());
for (NoteManager.Folder folder : folders) {
moveFolder(folder.getPath(), folder.getPath().replace("/~Trash", ""), subject);
}
}