|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ContentContainer
This class represents a container that contains one or more content entries. Can contain children containers.
Field Summary | |
---|---|
static int |
ALBUM_CONTAINER
Represents the base album container. |
static int |
ALBUM_CONTAINER_MUSIC
Represents a music album container. |
static int |
ALBUM_CONTAINER_PHOTO
Represents a photo album container. |
static int |
CONTAINER
Represents the base container class. |
static int |
GENRE_CONTAINER
Represents an unordered collection of 'objects' that "belong" to the genre. |
static int |
GENRE_CONTAINER_MOVIE
Represents a movie genre container. |
static int |
GENRE_CONTAINER_MUSIC
Represents a music genre container. |
static int |
PERSON_CONTAINER
Represents an unordered collection of 'objects' that "belong" to the people. |
static int |
PERSON_CONTAINER_MUSIC_ARTIST
Represents a music artist person container. |
static int |
PLAYLIST_CONTAINER
Represents a collection of objects. |
static int |
STORAGE_FOLDER_CONTAINER
Represents all, or a partition of some physical storage unit of a single type. |
static int |
STORAGE_SYSTEM_CONTAINER
Represents a potentially heterogeneous collection of storage media. |
static int |
STORAGE_VOLUME_CONTAINER
Represents all, or a partition of, some physical storage unit of a single type. |
Method Summary | |
---|---|
boolean |
addContentEntry(ContentEntry entry)
Adds a ContentEntry to this ContentContainer. |
boolean |
contains(ContentEntry entry)
Checks whether the given ContentEntry is in this ContentContainer
in local cache only. |
boolean |
createContentContainer(String name,
ExtendedFileAccessPermissions permissions)
Creates a new ContentContainer as a child of this ContentContainer, in local cache only; does not cause network activity. |
boolean |
delete()
Deletes this ContentContainer if and only if it is empty. |
boolean |
deleteContents()
Deletes all the ContentEntry objects in this container except for ContentContainer entries. |
boolean |
deleteRecursive(boolean recursive)
Deletes this ContentContainer and all of its ContentEntry objects. |
int |
getComponentCount()
Gets the number of ContentEntry objects in this ContentContainer. |
int |
getContainerClass()
Returns the container class of this container. |
long |
getContentSize()
Gets the size of the ContentContainer and all its content including all its contained ContentContainer objects. |
Date |
getCreationDate()
Returns the creation date of this ContentContainer. |
Enumeration |
getEntries()
Gets an Enumeration over all entries in this ContentContainer, from local cache only; does not cause network activity. |
ContentList |
getEntries(ContentDatabaseFilter filter,
boolean traverse)
Returns a ContentList which contains the filtered ContentItems of this ContentContainer. |
ContentEntry |
getEntry(int n)
Returns the nth ContentEntry in this container, from local cache only; does not cause network activity. |
ExtendedFileAccessPermissions |
getExtendedFileAccessPermissions()
Gets the ExtendedFileAccessPermissions of this ContentContainer. |
int |
getIndex(ContentEntry n)
Gets the index of the specified ContentEntry, from local cache only; does not cause network activity. |
String |
getName()
Gets the name of this ContentContainer. |
boolean |
isEmpty()
Returns an empty indication. |
NetActionRequest |
requestNewEntry(ContentEntry entry,
ContentServer server,
NetActionHandler handler)
Requests a ContentEntry be created and added to a Container in a remote server. |
ContentEntry[] |
toArray()
Returns an array of all ContentEntry
in this ContentContainers including other
ContentContainers . |
Methods inherited from interface org.ocap.hn.content.ContentEntry |
---|
getMetadata, getParent, getServer |
Field Detail |
---|
static final int CONTAINER
static final int ALBUM_CONTAINER
static final int ALBUM_CONTAINER_MUSIC
static final int ALBUM_CONTAINER_PHOTO
static final int GENRE_CONTAINER
static final int GENRE_CONTAINER_MUSIC
static final int GENRE_CONTAINER_MOVIE
static final int PLAYLIST_CONTAINER
static final int PERSON_CONTAINER
static final int PERSON_CONTAINER_MUSIC_ARTIST
static final int STORAGE_SYSTEM_CONTAINER
static final int STORAGE_VOLUME_CONTAINER
static final int STORAGE_FOLDER_CONTAINER
Method Detail |
---|
int getContainerClass()
ALBUM_CONTAINER
,
ALBUM_CONTAINER_MUSIC
,
ALBUM_CONTAINER_PHOTO
,
GENRE_CONTAINER
,
GENRE_CONTAINER_MUSIC
,
GENRE_CONTAINER_MOVIE
,
PLAYLIST_CONTAINER
,
PERSON_CONTAINER
,
PERSON_CONTAINER_MUSIC_ARTIST
,
STORAGE_SYSTEM_CONTAINER
,
STORAGE_VOLUME_CONTAINER
,
STORAGE_FOLDER_CONTAINER
ContentEntry[] toArray()
ContentEntry
in this ContentContainers
including other
ContentContainers
. Returns ContentEntry objects stored
in local cache only; does not cause network activity.
boolean contains(ContentEntry entry)
ContentEntry
is in this ContentContainer
in local cache only.
entry
- To search for in this ContentEntry.
ContentEntry getEntry(int n)
n
- Index of the entry to get.
ArrayIndexOutOfBoundsException
- if the nth value does
not exist.Enumeration getEntries()
int getIndex(ContentEntry n)
n
- The index of the ContentEntry to search for.
boolean createContentContainer(String name, ExtendedFileAccessPermissions permissions) throws SecurityException
name
- The name of the new ContentContainer.permissions
- Access permissions of the new ContentContainer.
SecurityException
- if the application is denied to
perform the action. Determined by ExtendedFileAccessPermissions
if the container is local, otherwise determined by protocol
specific security, e.g., UPnP SecurityConsole.ContentList getEntries(ContentDatabaseFilter filter, boolean traverse)
filter
- A ContentDatabaseFilter to filter the ContentItems. If
the filter is null all entries are returnedtraverse
- If true entries in the sub-containers are returned,
otherwise only entries in this ContentContainer are returned.
ContentDatabaseFilter
String getName()
getName
in interface ContentEntry
ContentEntry.getName()
boolean delete() throws IOException, SecurityException
delete
in interface ContentEntry
SecurityException
- if the application is denied to
perform the action
IOException
- if this ContentContainer is not local.boolean deleteContents() throws IOException, SecurityException
ContentEntry.delete()
method on each entry in this container. References to ContentEntry
objects in this container are not valid after this call when the
deletions are successful. This method deletes local ContentEntry
instances only. If the #isLocal method returns false, an exception is
thrown.
SecurityException
- if the calling application does
not have ExtendedFileAccessPermission to delete any of the
ContentEntry objects in this container.
IOException
- if this ContentContainer is not local.boolean deleteRecursive(boolean recursive) throws IOException, SecurityException
recursive
- if true all entries and their entries will be deleted.
SecurityException
- if the application is denied to perform the action
IOException
- if action fails due to an IO error.ContentManagementModule.delete(Locator, NetActionHandler)
,
delete()
boolean addContentEntry(ContentEntry entry)
long getContentSize()
getContentSize
in interface ContentEntry
Date getCreationDate()
getCreationDate
in interface ContentEntry
ExtendedFileAccessPermissions getExtendedFileAccessPermissions()
getExtendedFileAccessPermissions
in interface ContentEntry
int getComponentCount()
boolean isEmpty()
NetActionRequest requestNewEntry(ContentEntry entry, ContentServer server, NetActionHandler handler) throws IllegalArgumentException
entry
- The entry to add in this container.server
- The ContentServer to request the new entry on.handler
- NetActionHandler which gets informed once the
request completes.
IllegalArgumentException
- if the entry or handler parameter is
null. If the entry is a ContentContainer and is not empty.
DatabaseException
- if this Container is local; #isLocal returns
true.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |