org.basex.core.cmd
Class DropDB

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

public final class DropDB
extends ACreate

Evaluates the 'drop database' command and deletes a database.

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
DropDB(java.lang.String name)
          Default constructor.
 
Method Summary
 void build(CmdBuilder cb)
          Builds a string representation from the command.
 void databases(LockResult lr)
          Adds the names of the databases that may be touched by the process.
static boolean drop(IOFile path)
          Drops a database directory.
static boolean drop(IOFile path, java.lang.String pat)
          Recursively drops files in database directory with the specified pattern.
static boolean drop(java.lang.String db, Context ctx)
          Deletes the specified database.
 boolean newData(Context ctx)
          Closes an open data reference and returns true if this command will change the Context.data reference.
protected  boolean run()
          Executes the command and serializes the result (internal call).
 
Methods inherited from class org.basex.core.cmd.ACreate
create, drop, 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, 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

DropDB

public DropDB(java.lang.String name)
Default constructor.

Parameters:
name - name of database
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

drop

public static boolean drop(java.lang.String db,
                           Context ctx)
Deletes the specified database.

Parameters:
db - name of the database
ctx - database context
Returns:
success flag

drop

public static boolean drop(IOFile path)
Drops a database directory.

Parameters:
path - database path
Returns:
success of operation

drop

public static boolean drop(IOFile path,
                           java.lang.String pat)
Recursively drops files in database directory with the specified pattern.

Parameters:
path - database path
pat - file pattern
Returns:
success of operation

newData

public boolean newData(Context ctx)
Description copied from class: Command
Closes an open data reference and returns true if this command will change the Context.data reference. This method is required by the progress dialog in the frontend.

Overrides:
newData in class ACreate
Parameters:
ctx - database context
Returns:
result of check

databases

public void databases(LockResult lr)
Description copied from class: Proc
Adds the names of the databases that may be touched by the process.

Overrides:
databases in class ACreate
Parameters:
lr - Container for lock result to pass around

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