public class DirectoryServerResource extends ServerResource
| Constructor and Description |
|---|
DirectoryServerResource() |
| Modifier and Type | Method and Description |
|---|---|
Representation |
delete()
Deletes the resource and all its representations.
|
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()
Returns a full representation.
|
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()
Returns a modifiable list of exposed variants for the current request method.
|
protected List<Variant> |
getVariants(Method method)
Returns the list of variants for the given method.
|
Representation |
handle()
Handles any call to this resource.
|
boolean |
isDirectoryTarget()
Indicates if the target resource is a directory.
|
boolean |
isFileTarget()
Indicates if the target resource is a file.
|
void |
preventUpperDirectoryAccess()
Prevent the client from accessing resources in upper directories
|
Representation |
put(Representation entity)
Creates or updates a resource with the given representation as new state to
be stored.
|
void |
setTargetUri(String targetUri)
Sets the context's target URI (file, clap URI).
|
abort, commit, delete, describeVariants, doCatch, doConditionalHandle, doError, doHandle, doHandle, doHandle, doNegotiatedHandle, get, getAnnotation, getAnnotation, getAnnotations, getAttribute, getDescription, getInfo, getInfo, getName, getOnSent, getPreferredVariant, getRole, hasAnnotations, head, head, isAnnotated, isAutoCommitting, isCommitted, isConditional, isExisting, isInRole, isNegotiated, options, options, patch, patch, post, post, put, redirectPermanent, redirectPermanent, redirectSeeOther, redirectSeeOther, redirectTemporary, redirectTemporary, setAllowedMethods, setAnnotated, setAttribute, setAutoCommitting, setChallengeRequests, setCommitted, setConditional, setCookieSettings, setDescription, setDimensions, setExisting, setLocationRef, setLocationRef, setName, setNegotiated, setOnSent, setProxyChallengeRequests, setServerInfo, setStatus, setStatus, setStatus, setStatus, updateAllowedMethods, updateDimensionsdoError, doRelease, getAllowedMethods, getApplication, getChallengeRequests, getChallengeResponse, getClientInfo, getConditions, getConnegService, getContext, getConverterService, getCookies, getCookieSettings, getDimensions, getHostRef, getLocationRef, getLogger, getMatrix, getMatrixValue, getMaxForwards, getMetadataService, getMethod, getOriginalRef, getProtocol, getProxyChallengeRequests, getProxyChallengeResponse, getQuery, getQueryValue, getRanges, getReference, getReferrerRef, getRequest, getRequestAttributes, getRequestCacheDirectives, getRequestEntity, getResponse, getResponseAttributes, getResponseCacheDirectives, getResponseEntity, getRootRef, getServerInfo, getStatus, getStatusService, init, isConfidential, isLoggable, release, setApplication, setQueryValue, setRequest, setResponse, toBoolean, toByte, toDouble, toFloat, toInteger, toLong, toObject, toRepresentation, toRepresentation, toRepresentation, toShort, toStringpublic Representation delete() throws ResourceException
ServerResourceServerResource.isNegotiated(), otherwise the ServerResource.delete(Variant) method is
invoked.Status.CLIENT_ERROR_METHOD_NOT_ALLOWED.delete in class ServerResourceResourceExceptionpublic void doInit()
throws ResourceException
doInit in class ResourceResourceExceptionResource.init(Context, Request, Response)protected Representation get() throws ResourceException
ServerResourceServerResource.isNegotiated() ,
otherwise the ServerResource.get(Variant) method is invoked.Status.CLIENT_ERROR_METHOD_NOT_ALLOWED.get in class ServerResourceResourceExceptionpublic 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()
ServerResourcegetVariants in class ServerResourceprotected List<Variant> getVariants(Method method)
getVariants in class ServerResourcemethod - The related method.public Representation handle()
ServerResourceServerResource.isConditional() and ServerResource.isNegotiated() method to determine
which one of the ServerResource.doConditionalHandle(),
ServerResource.doNegotiatedHandle() and ServerResource.doHandle() methods should be
invoked. It also catches any ResourceException thrown and updates the
response status using the ServerResource.setStatus(Status, Throwable, String)
method.Status.CLIENT_ERROR_METHOD_NOT_ALLOWED, then
ServerResource.updateAllowedMethods() is invoked to give the resource a chance to
inform the client about the allowed methods.handle in class ServerResourcepublic boolean isDirectoryTarget()
public boolean isFileTarget()
public void preventUpperDirectoryAccess()
public Representation put(Representation entity) throws ResourceException
ServerResourceServerResource.isNegotiated(), otherwise the
ServerResource.put(Representation, Variant) method is invoked.Status.CLIENT_ERROR_METHOD_NOT_ALLOWED.put in class ServerResourceentity - The representation to store.ResourceExceptionpublic void setTargetUri(String targetUri)
targetUri - The context's target URI.Copyright © 2005–2025. All rights reserved.