org.ocap.hn.content
Interface ContentResource

All Superinterfaces:
ContentEntry
All Known Subinterfaces:
StreamableContentResource

public interface ContentResource
extends ContentEntry

Abstract class representing a media stream/file. Subclasses of this class can implement AudioResource and/or VideoResource depending on whether the content represents audio and/or video.


Field Summary
static String UNKNOWN_MIME_TYPE
          Constant for an unknown MIME type.
 
Method Summary
 boolean delete()
          Deletes the binary representation of this ContentResource and the ContentResource is removed from any containing ContentEntry.
 String getContentFormat()
          Returns the content format.
 ContentItem getContentItem()
          Gets the ContentItem this resource belongs to.
 long getContentSize()
          Gets the size of the content in bytes or -1 if not known.
 Date getCreationDate()
          Gets the creation date of the content or NULL if not known.
 ExtendedFileAccessPermissions getExtendedFileAccessPermissions()
          Returns the file permissions of a ContentResource.
 Locator getLocator()
          Gets an OcapLocator to the content associated with this ContentResource if the content can be located with that Locator type, otherwise returns an implementation specific Locator to the content.
 String getNetwork()
          Returns the network on which the content is available.
 String getProtocol()
          Returns the protocol which can be used to retrieve the content.
 Object getResourceProperty(String key)
          Returns properties of the resource.
 
Methods inherited from interface org.ocap.hn.content.ContentEntry
getMetadata, getName, getParent, getServer
 

Field Detail

UNKNOWN_MIME_TYPE

static final String UNKNOWN_MIME_TYPE
Constant for an unknown MIME type.

See Also:
Constant Field Values
Method Detail

delete

boolean delete()
               throws IOException,
                      SecurityException
Deletes the binary representation of this ContentResource and the ContentResource is removed from any containing ContentEntry. The ContentResource is not valid anymore after this call. This method deletes a local ContentResource only. If the #isLocal method returns false a exception is thrown. Does not delete the content associated with this ContentResource; see #getLocator.

Specified by:
delete in interface ContentEntry
Returns:
True if this ContentResource was deleted, otherwise returns false.
Throws:
SecurityException - if the application is does not have a write ExtendedFileAccessPermission.
IOException - if the ContentResource is not local.
See Also:
ContentManagementModule.delete(Locator, NetActionHandler)

getContentItem

ContentItem getContentItem()
Gets the ContentItem this resource belongs to.

Returns:
The ContentItem parent of this resource or null if this ContentResource is an independent ContentEntry.

getContentSize

long getContentSize()
Gets the size of the content in bytes or -1 if not known.

Specified by:
getContentSize in interface ContentEntry
Returns:
the content size in bytes

getCreationDate

Date getCreationDate()
Gets the creation date of the content or NULL if not known.

Specified by:
getCreationDate in interface ContentEntry
Returns:
The Date the content was created.

getLocator

Locator getLocator()
Gets an OcapLocator to the content associated with this ContentResource if the content can be located with that Locator type, otherwise returns an implementation specific Locator to the content.

Returns:
Locator to the content associated with this entry.

getExtendedFileAccessPermissions

ExtendedFileAccessPermissions getExtendedFileAccessPermissions()
Returns the file permissions of a ContentResource.

Specified by:
getExtendedFileAccessPermissions in interface ContentEntry
Returns:
the extended file access permissions of the ContentEntry.

getProtocol

String getProtocol()
Returns the protocol which can be used to retrieve the content. The returned String can be a wild card "*".
Possible protocols are

Returns:
String representation of the protocol

getNetwork

String getNetwork()
Returns the network on which the content is available. The returned String can be a wild card "*".
<protocol> <network>
"http-get" "*"
"rtsp-rtp-udp" "*"
"internal" IP address of the device hosting the Connection manager
"iec61883" GUID of the 1394 bus Isochronous Resource Manager
ICANN domain Vendor-defined, may be "*"

Returns:
String describing the network on which the resource is available.

getContentFormat

String getContentFormat()
Returns the content format. The returned String can be a wild card "*".
<protocol> <network>
"http-get" MIME-type
"rtsp-rtp-udp" Name of RTP payload type
"internal" Vendor-defined, may be "*"
"iec61883" Name standardised by IEC61883
ICANN domain Vendor-defined, may be "*"

Returns:
String describing the content format.

getResourceProperty

Object getResourceProperty(String key)
Returns properties of the resource. There is a set of defined properties which can be accessed via the methods in AudioResource and VideoResource. This method allows for custom or new properties.

Parameters:
key - The key of the property.
Returns:
The value of the property, or null if the key parameter does not match any property.