org.basex.core.cmd
Class Add

java.lang.Object
  extended by org.basex.core.Proc
      extended by org.basex.core.Command
          extended by org.basex.core.cmd.ACreate
              extended by org.basex.core.cmd.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-12, BSD License, Christian Gruen

Field Summary
 
Fields inherited from class org.basex.core.Command
args, context, in, mprop, out, perf, prop
 
Fields inherited from class org.basex.core.Proc
listen, updating
 
Constructor Summary
Add(java.lang.String path)
          Constructor, specifying a target path.
Add(java.lang.String path, java.lang.String input)
          Constructor, specifying a target path and an input.
 
Method Summary
 void build(CmdBuilder cb)
          Builds a string representation from the command.
protected  double prog()
          Returns a progress value (0 - 1).
protected  boolean run()
          Executes the command and serializes the result (internal call).
protected  java.lang.String tit()
          Returns short information on this process.
 
Methods inherited from class org.basex.core.cmd.ACreate
create, databases, drop, newData, sourceToIO, stoppable, supportsProg
 
Methods inherited from class org.basex.core.Command
close, databases, error, execute, execute, getOption, getOption, info, info, result, run, run, setInput, setInput, toString, updated, updating
 
Methods inherited from class org.basex.core.Proc
abort, checkStop, det, detail, listen, proc, progress, registered, registered, startTimeout, stop, stopTimeout, title
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Add

public Add(java.lang.String path)
Constructor, specifying a target path. The input needs to be set via Command.setInput(InputStream). 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.

Parameters:
path - target path, optionally terminated by a new file name

Add

public Add(java.lang.String path,
           java.lang.String input)
Constructor, specifying a target path and an input. 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.

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 Detail

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

tit

protected java.lang.String tit()
Description copied from class: Proc
Returns short information on this process. Can be overwritten to give more detailed information.

Overrides:
tit in class Proc
Returns:
header information

prog

protected double prog()
Description copied from class: Proc
Returns a progress value (0 - 1). Can be overwritten to give more detailed information.

Overrides:
prog in class Proc
Returns:
header information