|
||||||||||
| 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 | |
|---|---|
String |
getBaseName()
Returns the local base name of the file. |
Directory |
getDirectory()
Returns the parent directory handler. |
String |
getDirectoryUri()
Returns the context's directory URI (file, clap URI). |
static Set<String> |
getExtensions(String entryName)
Returns the set of extensions contained in a given directory entry name. |
String |
getTargetUri()
Returns the context's target URI (file, clap URI). |
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(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 IOException
directory - The parent directory handler.request - The handled call.
IOException| Method Detail |
|---|
public static Set<String> getExtensions(String entryName)
entryName - The directory entry name.
public String getBaseName()
public Directory getDirectory()
public String getDirectoryUri()
public String getTargetUri()
public List<Variant> getVariants()
getVariants in class Resourcepublic void handleGet()
handleGet in class Resourcepublic boolean isDirectoryTarget()
public boolean isFileTarget()
public void removeRepresentations()
throws ResourceException
removeRepresentations in class ResourceResourceExceptionpublic void setTargetUri(String targetUri)
targetUri - The context's target URI.
public void storeRepresentation(Representation entity)
throws ResourceException
storeRepresentation in class ResourceResourceException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||