Package org.xmldb.api.sdk.modules
Class SimpleBinaryResource
- java.lang.Object
-
- org.xmldb.api.sdk.modules.BaseResource
-
- org.xmldb.api.sdk.modules.SimpleBinaryResource
-
- All Implemented Interfaces:
Resource,BinaryResource
- Direct Known Subclasses:
BinaryResourceImpl
public abstract class SimpleBinaryResource extends BaseResource implements BinaryResource
Resource for encapsulation of binary data that is stored in the data base. Support for BinaryResources is optional.
-
-
Field Summary
-
Fields inherited from interface org.xmldb.api.modules.BinaryResource
RESOURCE_TYPE
-
-
Constructor Summary
Constructors Constructor Description SimpleBinaryResource(Collection parent, java.lang.String id)Create a new BinaryResource without any content.SimpleBinaryResource(Collection parent, java.lang.String id, byte[] content)Create a fully initialized BinaryResource
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetContent()Retrieves the content from the resource.java.lang.StringgetResourceType()Returns the resource type for this Resource.voidsetContent(java.lang.Object value)Sets the content for this resource.-
Methods inherited from class org.xmldb.api.sdk.modules.BaseResource
getId, getParentCollection
-
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
getId, getParentCollection
-
-
-
-
Constructor Detail
-
SimpleBinaryResource
public SimpleBinaryResource(Collection parent, java.lang.String id)
Create a new BinaryResource without any content.
-
SimpleBinaryResource
public SimpleBinaryResource(Collection parent, java.lang.String id, byte[] content)
Create a fully initialized BinaryResource
-
-
Method Detail
-
getResourceType
public java.lang.String getResourceType() throws XMLDBExceptionReturns the resource type for this Resource.- Specified by:
getResourceTypein interfaceResource- Returns:
- the resource type for the Resource.
- Throws:
XMLDBException- with expected error codes.
ErrorCodes.VENDOR_ERRORfor any vendor specific errors that occur.
-
getContent
public java.lang.Object getContent() throws XMLDBExceptionRetrieves the content from the resource. The type of the content varies depending what type of resource is being used.- Specified by:
getContentin interfaceResource- Returns:
- the content of the resource.
- Throws:
XMLDBException- with expected error codes.
ErrorCodes.VENDOR_ERRORfor any vendor specific errors that occur.
-
setContent
public void setContent(java.lang.Object value) throws XMLDBExceptionSets the content for this resource. The type of content that can be set depends on the type of resource being used.- Specified by:
setContentin interfaceResource- Parameters:
value- the content value to set for the resource.- Throws:
XMLDBException- with expected error codes.
ErrorCodes.VENDOR_ERRORfor any vendor specific errors that occur.
-
-