public interface IEntity
IEntity interface is a base interface for ICollection and
IResource. | Modifier and Type | Method and Description |
|---|---|
void |
copyTo(String path)
Copies this entity to a collection at the specified
path. |
void |
create()
Forces this entity to be created at its current path.
|
void |
delete()
Removes this entity from the repository.
|
boolean |
exists()
Returns whether this entity is valid and exists on the backend.
|
IEntityInformation |
getInformation()
Returns an instance of
IEntityInformation through which one
can obtain information on the current entity. |
String |
getName()
Returns the name of this entity.
|
ICollection |
getParent()
Returns the collection that holds this entity.
|
String |
getPath()
Returns the path of this entity.
|
IRepository |
getRepository()
Returns the repository that holds this resource.
|
boolean |
isEmpty()
Returns whether this entity is empty.
|
void |
moveTo(String path)
Moves this entity to a collection at the specified
path. |
void |
renameTo(String name)
Changes the name of this entity to the specified value.
|
IRepository getRepository()
IRepository instanceString getName()
This is equal to the content of the path after the last slash in it.
String getPath()
The result may not be null.
Example: /repository/users/test.txt
Example: /repository/articles
ICollection getParent()
The result could be null should there be no parent (i.e.
this is the root).
ICollectionIEntityInformation getInformation() throws RepositoryReadException
IEntityInformation through which one
can obtain information on the current entity.
This method may not return null, however, the contents of
the returned IEntityInformation may return null
indicating that a given information is not available.
IEntityInformation instance with the meta-data of the entityRepositoryReadException - if for some reason a connection to the backend could not be
achieved.void create()
throws RepositoryWriteException
Whether the entity will be created as a resource or a collection depends
on whether it is an instance of IResource or ICollection.
RepositoryWriteException - if for some reason a connection to the backend could not be
achieved, or if an entity with this path already exists on
the backend.void delete()
throws RepositoryWriteException
If no such resource exists, this method does nothing.
RepositoryWriteException - if for some reason a connection to the backend could not be
achieved.void renameTo(String name) throws RepositoryWriteException
name - the new nameRepositoryWriteException - if for some reason a connection to the backend could not be achievedvoid moveTo(String path) throws RepositoryWriteException
path.
If this entity is of type ICollection, then all child entities
are copied too.
path - the new locationRepositoryWriteException - if for some reason a connection to the backend could not be achievedvoid copyTo(String path) throws RepositoryWriteException
path.
If this entity is of type ICollection, then all child entities
are copied too.
path - the location ot be copied toRepositoryWriteException - if for some reason a connection to the backend could not be achievedboolean exists()
throws RepositoryReadException
RepositoryReadException - if for some reason a connection to the backend could not be
achieved.boolean isEmpty()
throws RepositoryReadException
If the entity is a collection, implementations should check to see if it has any child entities.
If the entity is a resource, implementations should check to see if it
has any content.
Note: Calling this method on a resource can be
slow.
RepositoryReadException - if for some reason a connection to the backend could not be
achieved.Copyright © 2010–2018 Eclipse Foundation. All rights reserved.