org.xmldb.api.reference
public class DatabaseImpl extends SimpleDatabase
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
DATA_PREFIX
The default directory to look for to find the data files.
|
protected static java.lang.String |
DIR_PROP
The property to look for to set the directory
|
protected static java.lang.String |
SEP
The characters expected to separate the INSTANCE_NAME from the file system
path
|
CONFORMANCE_LEVEL, INSTANCE_NAME
Constructor and Description |
---|
DatabaseImpl() |
Modifier and Type | Method and Description |
---|---|
Collection |
getCollection(java.lang.String uri,
java.lang.String username,
java.lang.String password)
Retrieves a
Collection instance based on the URI provided
in the uri parameter. |
acceptsURI, getConformanceLevel, getName
getProperty, setProperty
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getProperty, setProperty
protected static final java.lang.String SEP
protected static final java.lang.String DIR_PROP
protected static final java.lang.String DATA_PREFIX
public Collection getCollection(java.lang.String uri, java.lang.String username, java.lang.String password) throws XMLDBException
Collection
instance based on the URI provided
in the uri
parameter. The URI format for this implementation
is ref:///path where path is a path in the file system. To locate the data
files the database expects a directory data to exist in the current
directory.getCollection
in interface Database
getCollection
in class SimpleDatabase
uri
- the URI to use to locate the collection.password
- The password to use for authentication to the database or
null if the database does not support authentication.Collection
instanceXMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.ErrroCodes.INVALID_URI
If the URI is not in a valid format. ErrroCodes.PERMISSION_DENIED
If the username
and password
were not accepted by the database.