|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.Handler
org.restlet.resource.Resource
com.noelios.restlet.local.DirectoryResource
public class DirectoryResource
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 | |
---|---|
DirectoryResource(Directory directory,
Request request,
Response response)
This constructor 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. |
Method Summary | |
---|---|
java.lang.String |
getBaseName()
Returns the local base name of the file. |
Directory |
getDirectory()
Returns the parent directory handler. |
java.lang.String |
getDirectoryUri()
Returns the context's directory URI (file, clap URI). |
static java.util.Set<java.lang.String> |
getExtensions(java.lang.String entryName)
Returns the set of extensions contained in a given directory entry name. |
java.lang.String |
getTargetUri()
Returns the context's target URI (file, clap URI). |
java.util.List<Variant> |
getVariants()
Returns the representation variants. |
void |
handleGet()
|
boolean |
isDirectoryTarget()
Indicates if the target resource is a directory. |
boolean |
isFileTarget()
Indicates if the target resource is a file. |
void |
removeRepresentations()
|
void |
setTargetUri(java.lang.String targetUri)
Sets the context's target URI (file, clap URI). |
void |
storeRepresentation(Representation entity)
|
Methods inherited from class org.restlet.resource.Resource |
---|
acceptRepresentation, allowDelete, allowGet, allowPost, allowPut, delete, getPreferredRepresentation, getPreferredVariant, getRepresentation, handleDelete, handlePost, handlePut, init, isAvailable, isModifiable, isNegotiateContent, isReadable, post, put, represent, represent, setAvailable, setModifiable, setNegotiateContent, setReadable, setVariants |
Methods inherited from class org.restlet.Handler |
---|
allowHead, allowOptions, generateRef, getAllowedMethods, getApplication, getContext, getLogger, getMatrix, getQuery, getRequest, getResponse, handleHead, handleOptions, setContext, setRequest, setResponse, updateAllowedMethods |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DirectoryResource(Directory directory, Request request, Response response) throws java.io.IOException
directory
- The parent directory handler.request
- The handled call.
java.io.IOException
Method Detail |
---|
public static java.util.Set<java.lang.String> getExtensions(java.lang.String entryName)
entryName
- The directory entry name.
public java.lang.String getBaseName()
public Directory getDirectory()
public java.lang.String getDirectoryUri()
public java.lang.String getTargetUri()
public java.util.List<Variant> getVariants()
getVariants
in class Resource
public void handleGet()
handleGet
in class Resource
public boolean isDirectoryTarget()
public boolean isFileTarget()
public void removeRepresentations() throws ResourceException
removeRepresentations
in class Resource
ResourceException
public void setTargetUri(java.lang.String targetUri)
targetUri
- The context's target URI.public void storeRepresentation(Representation entity) throws ResourceException
storeRepresentation
in class Resource
ResourceException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |