use of org.apache.zeppelin.notebook.NoteInfo in project zeppelin by apache.
the class AzureNotebookRepo method list.
@Override
public List<NoteInfo> list(AuthenticationInfo subject) throws IOException {
List<NoteInfo> infos = new LinkedList<>();
NoteInfo info = null;
for (ListFileItem item : rootDir.listFilesAndDirectories()) {
if (item.getClass() == CloudFileDirectory.class) {
CloudFileDirectory dir = (CloudFileDirectory) item;
try {
if (dir.getFileReference("note.json").exists()) {
info = new NoteInfo(getNote(dir.getName()));
if (info != null) {
infos.add(info);
}
}
} catch (StorageException | URISyntaxException e) {
String msg = "Error enumerating notebooks from Azure storage";
LOG.error(msg, e);
} catch (Exception e) {
LOG.error(e.getMessage(), e);
}
}
}
return infos;
}
use of org.apache.zeppelin.notebook.NoteInfo in project zeppelin by apache.
the class VFSNotebookRepo method list.
@Override
public List<NoteInfo> list(AuthenticationInfo subject) throws IOException {
FileObject rootDir = getRootDir();
FileObject[] children = rootDir.getChildren();
List<NoteInfo> infos = new LinkedList<>();
for (FileObject f : children) {
String fileName = f.getName().getBaseName();
if (f.isHidden() || fileName.startsWith(".") || fileName.startsWith("#") || fileName.startsWith("~")) {
// skip hidden, temporary files
continue;
}
if (!isDirectory(f)) {
// so it must be a directory
continue;
}
NoteInfo info = null;
try {
info = getNoteInfo(f);
if (info != null) {
infos.add(info);
}
} catch (Exception e) {
LOG.error("Can't read note " + f.getName().toString(), e);
}
}
return infos;
}
Aggregations