org.xmldb.api.sdk.modules

Class BaseResource

public abstract class BaseResource extends 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 Stringcontent
protected Stringid
protected Collectionparent
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
StringgetId()
Returns the unique id for this Resource or null if the resource is anonymous.
CollectiongetParentCollection()
Returns the Collection instance that this resource is associated with.

Field Detail

content

protected String content

id

protected String id

parent

protected Collection parent

Constructor Detail

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 Detail

getId

public String getId()
Returns the unique id for this Resource or null if the resource is anonymous.

Returns: the id for the Resource or null if no id exists.

getParentCollection

public Collection getParentCollection()
Returns the Collection instance that this resource is associated with.

Returns: the collection associated with the resource.