Class Restore


public final class Restore extends Command
Evaluates the 'restore' command and restores a backup of a database.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Constructor Details

    • Restore

      public Restore(String arg)
      Default constructor.
      Parameters:
      arg - optional argument
  • 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.
    • restore

      public static void restore(String db, String backup, StaticOptions sopts, Restore cmd) throws IOException
      Restores the specified database.
      Parameters:
      db - name of database
      backup - name of backup
      sopts - static options
      cmd - calling command instance
      Throws:
      IOException - I/O exception
    • shortInfo

      public String shortInfo()
      Description copied from class: Job
      Returns short progress information. Can be overwritten to give more specific feedback.
      Overrides:
      shortInfo in class Job
      Returns:
      header information
    • 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
    • supportsProg

      public boolean supportsProg()
      Description copied from class: Command
      Returns true if this command returns a progress value. This method is only required by the GUI.
      Overrides:
      supportsProg in class Command
      Returns:
      result of check