Class Add


public final class Add extends ACreate
Evaluates the 'add' command and adds a document to a collection. Note that the constructors of this class have changed with Version 7.0: the target path and file name have been merged and are now specified as first argument.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Constructor Details

    • Add

      public Add(String path)
      Constructor, specifying a target path. The input needs to be set via Command.setInput(InputStream).
      Parameters:
      path - target path, optionally terminated by a new file name
    • Add

      public Add(String path, String input)
      Constructor, specifying a target path and an input.
      Parameters:
      path - target path, optionally terminated by a new file name If null, the name of the input will be set as path.
      input - input file or XML string
  • 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
    • build

      public void build(CmdBuilder cb)
      Description copied from class: Command
      Builds a string representation from the command. This string must be correctly built, as commands are sent to the server as strings.
      Overrides:
      build in class Command
      Parameters:
      cb - command builder
    • 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
    • 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