org.ocap.hn.content
Interface ContentEntry

All Known Subinterfaces:
ContentContainer, ContentItem, NetRecordingEntry, RecordingContentItem

public interface ContentEntry

This interface represents a basic content entry. Each ContentEntry instance can only be contained in one ContentContainer and the implementation SHALL create a new ContentEntry for equal entries placed in multiple ContentContainer instances.


Method Summary
 boolean deleteEntry()
          Deletes this ContentEntry.
 long getContentSize()
          Gets the size of the content associated with this ContentEntry..
 Date getCreationDate()
          Gets the creation date of the content associated with this ContentEntry.
 ContentContainer getEntryParent()
          Returns the ContentContainer this ContentEntry belongs to.
 org.ocap.storage.ExtendedFileAccessPermissions getExtendedFileAccessPermissions()
          Gets the file permissions of this ContentEntry, or null if unknown.
 String getID()
          Returns the ID of this ContentEntry.
 String getParentID()
          Returns the ID of ContentContainer this ContentEntry belongs to.
 MetadataNode getRootMetadataNode()
          Gets the metadata for this ContentEntry.
 ContentServerNetModule getServer()
          Gets the server where this ContentEntry is located.
 boolean isLocal()
          Returns true if this content entry is on the local device, false if it is hosted by another device on the network.
 

Method Detail

getID

String getID()
Returns the ID of this ContentEntry. The format of this string ID is implementation and protocol mapping dependent.

Returns:
The ID of content entry.

getServer

ContentServerNetModule getServer()
Gets the server where this ContentEntry is located.

Returns:
The server housing this container.

deleteEntry

boolean deleteEntry()
                    throws IOException
Deletes this ContentEntry. This is a local delete only. If the #isLocal method returns false, this method SHALL throw an exception. This method does not delete any content associated with this content entry.

Returns:
True if the ContentEntry was deleted, otherwise returns false.
Throws:
SecurityException - if the calling application does not have write ExtendedFileAccessPermission for this entry.
IOException - if the entry is not local.

getEntryParent

ContentContainer getEntryParent()
                                throws IOException
Returns the ContentContainer this ContentEntry belongs to. This method SHALL return null if this ContentEntry represents a root container. If it is determined that this ContentEntry has a parent container, but the implementation does not have sufficient local cached information to construct the ContentContainer, this method SHALL throw an IOException.

Returns:
The parent ContentContainer.
Throws:
IOException - if the implementation does not have sufficient local cached information to construct the parent ContentContainer

getParentID

String getParentID()
Returns the ID of ContentContainer this ContentEntry belongs to. This method SHALL return "-1" if this ContentEntry represents a root container. This method SHALL return null if the parent ID is unknown.

Returns:
the ID of this entry's parent container
See Also:
getID(), getEntryParent()

getContentSize

long getContentSize()
Gets the size of the content associated with this ContentEntry..

Returns:
The content size in bytes or -1 if unknown.

getCreationDate

Date getCreationDate()
Gets the creation date of the content associated with this ContentEntry.

Returns:
The Date the content was created or null if unknown.

getExtendedFileAccessPermissions

org.ocap.storage.ExtendedFileAccessPermissions getExtendedFileAccessPermissions()
Gets the file permissions of this ContentEntry, or null if unknown.

Returns:
The extended file access permissions of this ContentEntry or null if unknown.

getRootMetadataNode

MetadataNode getRootMetadataNode()
Gets the metadata for this ContentEntry.

Returns:
Root MetadataNode.

isLocal

boolean isLocal()
Returns true if this content entry is on the local device, false if it is hosted by another device on the network.

Returns:
true if the content is local, false otherwise


Copyright © 2011. All Rights Reserved.