org.xmldb.api.sdk.modules

Class BaseResource

Implemented Interfaces:
Resource
Known Direct Subclasses:
SimpleBinaryResource, SimpleXMLResource

public abstract class BaseResource
extends java.lang.Object
implements Resource

Resource for encapsulation of binary data that is stored in the data base. Support for BinaryResources is optional.

The standard getContent method returns a OutputStream and the standard setContent expects an InputStream.

The stream types should be better clarified

Field Summary

protected String
content
protected String
id
protected Collection
parent

Constructor Summary

BaseResource(Collection parent, String id)
Create a new BinaryResource without any content.
BaseResource(Collection parent, String id, String content)
Create a fully initialized BinaryResource

Method Summary

String
getId()
Returns the unique id for this Resource or null if the resource is anonymous.
Collection
getParentCollection()
Returns the Collection instance that this resource is associated with.

Field Details

content

protected String content

id

protected String id

parent

protected Collection parent

Constructor Details

BaseResource

public BaseResource(Collection parent,
                    String id)
Create a new BinaryResource without any content.

BaseResource

public BaseResource(Collection parent,
                    String id,
                    String content)
Create a fully initialized BinaryResource

Method Details

getId

public String getId()
            throws XMLDBException
Returns the unique id for this Resource or null if the resource is anonymous.
Specified by:
getId in interface Resource
Returns:
the id for the Resource or null if no id exists.

getParentCollection

public Collection getParentCollection()
            throws XMLDBException
Returns the Collection instance that this resource is associated with.
Specified by:
getParentCollection in interface Resource
Returns:
the collection associated with the resource.