org.basex.core.cmd
Class Rename

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.Rename

public final class Rename
extends ACreate

Evaluates the 'rename' command and renames resources or directories in a collection.

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
Rename(java.lang.String source, java.lang.String target)
          Default constructor.
 
Method Summary
protected  boolean run()
          Executes the command and serializes the result (internal call).
static java.lang.String target(Data data, int pre, java.lang.String src, java.lang.String trg)
          Generates a target path for the specified document.
 
Methods inherited from class org.basex.core.cmd.ACreate
create, databases, drop, newData, sourceToIO, stoppable, supportsProg
 
Methods inherited from class org.basex.core.Command
build, 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, prog, progress, registered, registered, startTimeout, stop, stopTimeout, tit, title
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Rename

public Rename(java.lang.String source,
              java.lang.String target)
Default constructor.

Parameters:
source - source path
target - target path
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

target

public static java.lang.String target(Data data,
                                      int pre,
                                      java.lang.String src,
                                      java.lang.String trg)
Generates a target path for the specified document.

Parameters:
data - data reference
pre - pre value of the document
src - source path
trg - target path
Returns:
new name