Package org.xmldb.api.sdk.modules
Class BaseResource
- java.lang.Object
-
- org.xmldb.api.sdk.modules.BaseResource
-
- All Implemented Interfaces:
Resource
- Direct Known 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 standardgetContentmethod returns aOutputStreamand the standard setContent expects anInputStream. The stream types should be better clarified
-
-
Constructor Summary
Constructors Constructor Description BaseResource(Collection parent, java.lang.String id)Create a new BinaryResource without any content.BaseResource(Collection parent, java.lang.String id, java.lang.String content)Create a fully initialized BinaryResource
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetId()Returns the unique id for this Resource or null if the resource is anonymous.CollectiongetParentCollection()Returns theCollectioninstance that this resource is associated with.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.xmldb.api.base.Resource
getContent, getResourceType, setContent
-
-
-
-
Constructor Detail
-
BaseResource
public BaseResource(Collection parent, java.lang.String id)
Create a new BinaryResource without any content.
-
BaseResource
public BaseResource(Collection parent, java.lang.String id, java.lang.String content)
Create a fully initialized BinaryResource
-
-
Method Detail
-
getParentCollection
public Collection getParentCollection() throws XMLDBException
Returns theCollectioninstance that this resource is associated with.- Specified by:
getParentCollectionin interfaceResource- Returns:
- the collection associated with the resource.
- Throws:
XMLDBException- with expected error codes.
ErrorCodes.VENDOR_ERRORfor any vendor specific errors that occur.
-
getId
public java.lang.String getId() throws XMLDBExceptionReturns the unique id for this Resource or null if the resource is anonymous.- Specified by:
getIdin interfaceResource- Returns:
- the id for the Resource or null if no id exists.
- Throws:
XMLDBException- with expected error codes.
ErrorCodes.VENDOR_ERRORfor any vendor specific errors that occur.
-
-