Class NotebookReader

java.lang.Object
io.deephaven.enterprise.dnd.notebook.NotebookReader

public class NotebookReader extends Object
Tools for getting Files and Folders out of the Web IDE notebooks that are stored in DbInternal.WebClientData.

This is exposed from the deephaven_enterprise.notebook Python module.

  • Method Details

    • getNotebookText

      @NotNull public static String getNotebookText(@NotNull Database database, @NotNull String notebookName)
      Get the text of a notebook at the given path.
      Parameters:
      database - the database object to retrieve tables and the user context from (must be a DatabaseInternal)
      notebookName - the name of the notebook, starting with "/"
      Returns:
      the text of the notebook, if not found an Exception is thrown
    • getFileOrFolder

      @NotNull public static NotebookReader.FileOrFolder getFileOrFolder(@NotNull Database database, @NotNull String path, boolean usesSlash, @NotNull String suffix)
      Gets a FileOrFolder pointed to by path.

      This is used by the getNotebookText(io.deephaven.enterprise.database.Database, java.lang.String) and Python import machinery. In each case you must begin your path with a separator (e.g. "/bill.py" or ".bill"). The optional suffix is used for the imports to search for folders followed by files along the imported path.

      Parameters:
      database - the database object to retrieve tables and the user context from (must be a DatabaseInternal)
      path - the path to retrieve
      usesSlash - use "/+" for the path separator, otherwises uses "\." for Python imports
      suffix - the optional suffix to append to the last component (e.g., ".py" for an import); or empty if no suffix searching should be performed
      Returns:
      the FileOrFolder that was found at the given path, or an exception is thrown