org.xmldb.api.reference
public class CollectionImpl extends SimpleCollection
Collection is implemented as a directory in the file system.
| Field Summary | |
|---|---|
| protected File | collection |
| Constructor Summary | |
|---|---|
| CollectionImpl(String path) | |
| Method Summary | |
|---|---|
| void | close()
Releases all resources consumed by the Collection. |
| String | createId()
Creates a new unique ID within the context of the Collection
|
| Resource | createResource(String id, String type)
Creates a new empty Resource with the provided id.
|
| Collection | getChildCollection(String name)
Returns a Collection instance for the requested child collection
if it exists.
|
| int | getChildCollectionCount()
Returns the number of child collections under this
Collection.
|
| String | getName()
Returns the name of the collection
|
| Collection | getParentCollection()
Returns the parent collection for this collection or null if no parent
collection exists.
|
| Resource | getResource(String id)
Retrieves a Resource from the database.
|
| int | getResourceCount()
Returns the number of resources currently stored in this collection or 0
if the collection is empty.
|
| String[] | listChildCollections()
Returns a list of collection names naming all child collections
of the current collection.
|
| String[] | listResources()
Returns a list of the ids for all resources stored in the collection.
|
| void | removeResource(Resource res)
Removes the Resource from the database.
|
| void | storeResource(Resource res)
Stores the provided resource into the database.
|
| protected void | validateResource(Resource res)
Makes sure the resource is valid. |
Collection.Collection
Returns: the created id as a string.
Resource with the provided id.
Parameters: id the unique id to associate with the created Resource. type the Resource type to create.
Returns: an empty Resource instance.
Collection instance for the requested child collection
if it exists.
Parameters: name the name of the child collection to retrieve.
Returns: the requested child collection or null if it couldn't be found.
Collection.
Returns: the number of child collections.
Returns: the name of the object.
Returns: the parent Collection instance.
Resource from the database.
Parameters: id the unique id for the requested resource.
Returns: The retrieved Resource instance.
Returns: the number of resources in the collection.
Returns: an array containing collection names for all child collections.
Returns: a string array containing the names for all
Resources in the collection.
Resource from the database.
Parameters: res the resource to remove.
Parameters: res the resource to store in the database.