|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.noelios.restlet.local.Entity
public abstract class Entity
Represents a local entity, for example a regular file or a directory.
Constructor Summary | |
---|---|
Entity()
|
Method Summary | |
---|---|
abstract boolean |
exists()
Indicates if the entity does exist. |
java.lang.String |
getBaseName(MetadataService metadataService)
Return the base name of this entity that is to say the longest part of the name without known extensions (beginning from the left). |
static java.lang.String |
getBaseName(java.lang.String name,
MetadataService metadataService)
Return the base name that is to say the longest part of a given name without known extensions (beginning from the left). |
abstract java.util.List<Entity> |
getChildren()
Returns the list of contained entities if the current entity is a directory, null otherwise. |
java.util.Collection<java.lang.String> |
getExtensions(MetadataService metadataService)
Returns the list of known extensions. |
static java.util.Collection<java.lang.String> |
getExtensions(java.lang.String name,
MetadataService metadataService)
Returns the list of known extensions taken from a given entity name. |
abstract java.lang.String |
getName()
Returns the name. |
abstract Entity |
getParent()
Returns the parent directory (if any). |
abstract Representation |
getRepresentation(MediaType defaultMediaType,
int timeToLive)
Returns a representation of this local entity. |
abstract boolean |
isDirectory()
Indicates if the entity is a directory. |
abstract boolean |
isNormal()
Indicates if the entity is a normal entity, especially if it is not a directory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Entity()
Method Detail |
---|
public static java.lang.String getBaseName(java.lang.String name, MetadataService metadataService)
name
- The given name.metadataService
- Service that holds the known extensions.
public static java.util.Collection<java.lang.String> getExtensions(java.lang.String name, MetadataService metadataService)
name
- the given name.metadataService
- Service that holds the known extensions.
public abstract boolean exists()
public java.lang.String getBaseName(MetadataService metadataService)
metadataService
- Service that holds the known extensions.
public abstract java.util.List<Entity> getChildren()
public java.util.Collection<java.lang.String> getExtensions(MetadataService metadataService)
metadataService
- Service that maps extension names to metadata.
public abstract java.lang.String getName()
public abstract Entity getParent()
public abstract Representation getRepresentation(MediaType defaultMediaType, int timeToLive)
defaultMediaType
- The default media typetimeToLive
- the time to live of this representation
public abstract boolean isDirectory()
public abstract boolean isNormal()
File.isFile()
,
File.isDirectory()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |