|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.resource.Resource
org.restlet.resource.UniformResource
org.restlet.resource.ServerResource
org.restlet.engine.local.DirectoryServerResource
public class DirectoryServerResource
Resource supported by a set of context representations (from file system, class loaders and webapp context). A content negotiation mechanism (similar to Apache HTTP server) is available. It is based on path extensions to detect variants (languages, media types or character sets).
Constructor Summary | |
---|---|
DirectoryServerResource()
|
Method Summary | |
---|---|
Representation |
delete()
|
void |
doInit()
This initialization method aims at answering the following questions: does this request target a directory? does this request target a directory, with an index file? should this request be redirected (target is a directory with no trailing "/")? does this request target a file? The following constraints must be taken into account: the underlying helper may not support content negotiation and be able to return the list of possible variants of the target file (e.g. |
protected Representation |
get()
|
String |
getBaseName()
Returns the local base name of the file. |
protected Restlet |
getClientDispatcher()
Returns a client dispatcher. |
Directory |
getDirectory()
Returns the parent directory handler. |
protected ReferenceList |
getDirectoryContent()
If the resource is a directory, this returns its content. |
String |
getDirectoryUri()
Returns the context's directory URI (file, clap URI). |
protected Response |
getRepresentation(String resourceUri,
MediaType acceptedMediaType)
Returns a representation of the resource at the target URI. |
String |
getTargetUri()
Returns the context's target URI (file, clap URI). |
List<Variant> |
getVariants()
|
protected List<Variant> |
getVariants(Method method)
Returns the list of variants for the given method. |
Representation |
handle()
|
boolean |
isDirectoryTarget()
Indicates if the target resource is a directory. |
boolean |
isFileTarget()
Indicates if the target resource is a file. |
Representation |
put(Representation entity)
|
void |
setTargetUri(String targetUri)
Sets the context's target URI (file, clap URI). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DirectoryServerResource()
Method Detail |
---|
public Representation delete() throws ResourceException
delete
in class ServerResource
ResourceException
public void doInit() throws ResourceException
doInit
in class Resource
ResourceException
protected Representation get() throws ResourceException
get
in class ServerResource
ResourceException
public String getBaseName()
protected Restlet getClientDispatcher()
public Directory getDirectory()
protected ReferenceList getDirectoryContent()
public String getDirectoryUri()
protected Response getRepresentation(String resourceUri, MediaType acceptedMediaType)
resourceUri
- The URI of the target resource.acceptedMediaType
- The accepted media type or null.
public String getTargetUri()
public List<Variant> getVariants()
getVariants
in class ServerResource
protected List<Variant> getVariants(Method method)
getVariants
in class ServerResource
method
- The related method.
public Representation handle()
handle
in class ServerResource
public boolean isDirectoryTarget()
public boolean isFileTarget()
public Representation put(Representation entity) throws ResourceException
put
in class ServerResource
ResourceException
public void setTargetUri(String targetUri)
targetUri
- The context's target URI.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |