Class Copy


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

    • Copy

      public Copy(String db, String newdb)
      Default constructor.
      Parameters:
      db - db name
      newdb - new db name
  • 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
    • copy

      public static void copy(String source, String target, StaticOptions sopts, Copy cmd) throws IOException
      Copies the specified database.
      Parameters:
      source - name of the database
      target - new database name
      sopts - static options
      cmd - calling command (can be null)
      Throws:
      IOException - I/O exception
    • 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
    • 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
    • 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
    • progressInfo

      public double progressInfo()
      Description copied from class: Job
      Returns a progress value (0 - 1). Can be overwritten to give more specific feedback.
      Overrides:
      progressInfo in class Job
      Returns:
      header information