Class Open


public final class Open extends Command
Evaluates the 'open' command and opens a database.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Constructor Details

    • Open

      public Open(String name)
      Default constructor.
      Parameters:
      name - name of database
    • Open

      public Open(String name, String path)
      Default constructor.
      Parameters:
      name - name of database
      path - database path (can be null)
  • Method Details

    • run

      protected boolean run()
      Description copied from class: Command
      Executes the command and serializes the result (internal call).
      Specified by:
      run in class Command
      Returns:
      success of operation
    • addLocks

      public void addLocks()
      Description copied from class: Job
      Adds the strings (databases, special identifiers) for which locks need to be acquired.
      Overrides:
      addLocks in class Job
    • newData

      public boolean newData(Context ctx)
      Description copied from class: Command
      Closes an open data reference and returns true if this command will change the Context.data() reference. This method is only required by the GUI.
      Overrides:
      newData in class Command
      Parameters:
      ctx - database context
      Returns:
      result of check
    • open

      public static Data open(String name, Context context, MainOptions options) throws IOException
      Opens the specified database.
      Parameters:
      name - name of database
      context - database context
      options - main options
      Returns:
      data reference
      Throws:
      IOException - I/O exception