|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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)
Constructor. |
Method Summary | |
---|---|
boolean |
allowDelete()
Indicates if it is allowed to delete the resource. |
boolean |
allowPut()
Indicates if it is allowed to put to the resource. |
void |
delete()
Asks the resource to delete itself and all its representations. |
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()
|
void |
put(Representation variant)
Puts a variant representation in the resource. |
void |
setTargetUri(String targetUri)
Sets the context's target URI (file, clap URI). |
Methods inherited from class org.restlet.resource.Resource |
---|
allowGet, allowPost, generateRef, getContext, getLogger, getPreferredRepresentation, getPreferredVariant, getRepresentation, getRequest, getResponse, handleDelete, handleHead, handleOptions, handlePost, handlePut, init, isNegotiateContent, post, setContext, setNegotiateContent, setRequest, setResponse |
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 boolean allowDelete()
allowDelete
in class Resource
public boolean allowPut()
allowPut
in class Resource
public void handleGet()
handleGet
in class Resource
public void delete()
delete
in class Resource
public void put(Representation variant)
put
in class Resource
variant
- A new or updated variant representation.public String getBaseName()
public Directory getDirectory()
public String getDirectoryUri()
public String getTargetUri()
public List<Variant> getVariants()
getVariants
in class Resource
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 |