Package org.basex.core.cmd
Class Add
- java.lang.Object
-
- org.basex.core.jobs.Job
-
- org.basex.core.Command
-
- org.basex.core.cmd.ACreate
-
- 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-24, BSD License, Christian Gruen
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
build(CmdBuilder cb)
Builds a string representation from the command.double
progressInfo()
Returns a progress value (0 - 1).protected boolean
run()
Executes the command and serializes the result (internal call).String
shortInfo()
Returns short progress information.-
Methods inherited from class org.basex.core.cmd.ACreate
addLocks, newData, stoppable, supportsProg
-
Methods inherited from class org.basex.core.Command
addLocks, baseURI, baseURI, close, error, execute, execute, getOption, getOption, info, info, init, run, run, setInput, setInput, toString, toString, updated, updating
-
-
-
-
Constructor Detail
-
Add
public Add(String path)
Constructor, specifying a target path. The input needs to be set viaCommand.setInput(InputStream)
.- Parameters:
path
- target path, optionally terminated by a new file name
-
-
Method Detail
-
run
protected boolean run()
Description copied from class:Command
Executes the command and serializes the result (internal call).
-
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.
-
shortInfo
public String shortInfo()
Description copied from class:Job
Returns short progress information. Can be overwritten to give more specific feedback.
-
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 classJob
- Returns:
- header information
-
-