org.basex.core.proc
Class Create

java.lang.Object
  extended by org.basex.core.Progress
      extended by org.basex.core.AbstractProcess
          extended by org.basex.core.proc.Proc
              extended by org.basex.core.proc.Create

public final class Create
extends Proc

Evaluates the 'create' command. Creates a new database instance for the specified arguments.

Author:
Workgroup DBIS, University of Konstanz 2005-07, ISC License, Christian Gruen

Field Summary
static java.lang.String ATV
          Create index option.
static java.lang.String FS
          Create option.
static java.lang.String FTX
          Create index option.
static java.lang.String INDEX
          Create option.
static java.lang.String MAB2
          Create option.
static java.lang.String SAX
          Create option.
static java.lang.String TXT
          Create index option.
static java.lang.String WRD
          Create index option.
static java.lang.String XML
          Create option.
 
Fields inherited from class org.basex.core.AbstractProcess
cmd
 
Constructor Summary
Create()
           
 
Method Summary
static java.lang.String chopPath(java.lang.String name)
          Chops the path and the XML suffix of the specified filename.
static java.lang.String filePath(java.lang.String file, boolean addXML)
          Returns the filename if the specified file exists or throws an exception.
static Data xml(java.lang.String db, java.lang.String fn)
          Creates and returns a database for the specified XML document.
 
Methods inherited from class org.basex.core.proc.Proc
det, execute, execute, get, head, info, info, output, output, prog, result, toString
 
Methods inherited from class org.basex.core.Progress
detail, header, progress, progress, stop, stopped
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ATV

public static final java.lang.String ATV
Create index option.

See Also:
Constant Field Values

FS

public static final java.lang.String FS
Create option.

See Also:
Constant Field Values

FTX

public static final java.lang.String FTX
Create index option.

See Also:
Constant Field Values

INDEX

public static final java.lang.String INDEX
Create option.

See Also:
Constant Field Values

MAB2

public static final java.lang.String MAB2
Create option.

See Also:
Constant Field Values

SAX

public static final java.lang.String SAX
Create option.

See Also:
Constant Field Values

TXT

public static final java.lang.String TXT
Create index option.

See Also:
Constant Field Values

WRD

public static final java.lang.String WRD
Create index option.

See Also:
Constant Field Values

XML

public static final java.lang.String XML
Create option.

See Also:
Constant Field Values
Constructor Detail

Create

public Create()
Method Detail

chopPath

public static java.lang.String chopPath(java.lang.String name)
Chops the path and the XML suffix of the specified filename.

Parameters:
name - filename
Returns:
chopped filename

filePath

public static java.lang.String filePath(java.lang.String file,
                                        boolean addXML)
                                 throws java.io.FileNotFoundException
Returns the filename if the specified file exists or throws an exception.

Parameters:
file - file to be checked
addXML - add xml suffix if file was not found
Returns:
null or error string
Throws:
java.io.FileNotFoundException - file not found exception

xml

public static Data xml(java.lang.String db,
                       java.lang.String fn)
Creates and returns a database for the specified XML document. No warnings are thrown; instead, an empty reference is returned.

Parameters:
db - name of the database to be created
fn - database name
Returns:
database instance