fr.cnes.sitools.proxy
Class AbstractDirectoryServerResource

java.lang.Object
  extended by org.restlet.resource.UniformResource
      extended by org.restlet.resource.ServerResource
          extended by fr.cnes.sitools.proxy.AbstractDirectoryServerResource
Direct Known Subclasses:
DirectoryProxyResource, DirectoryUserResource

public abstract class AbstractDirectoryServerResource
extends org.restlet.resource.ServerResource

Base class for Sitools Directory resources Additional methods :

Author:
m.marseille (AKKA Technologies)
See Also:
#upload(Representation)}, class in Restlet : {@link #DirectoryServerResource()}

Constructor Summary
AbstractDirectoryServerResource()
           
 
Method Summary
 org.restlet.representation.Representation get()
           
 java.lang.String getBaseName()
          Returns the local base name of the file.
 org.restlet.representation.Variant getBaseVariant()
          Gets the baseVariant value
 org.restlet.Client getClientDispatcher()
          Returns a client dispatcher.
 org.restlet.resource.Directory getDirectory()
          Returns the parent directory handler.
 org.restlet.data.ReferenceList getDirectoryContent()
          If the resource is a directory, this returns its content.
 java.lang.String getDirectoryUri()
          Returns the context's directory URI (file, clap URI).
 org.restlet.representation.Representation getFileContent()
          Gets the fileContent value
 java.lang.String getIndexName()
          Gets the indexName value
 org.restlet.data.Reference getOriginalRef()
          Gets the originalRef value
 org.restlet.representation.Variant getProtoVariant()
          Gets the protoVariant value
 java.lang.String getRelativePart()
          Gets the relativePart value
 org.restlet.Response getRepresentation(java.lang.String resourceUri)
          Returns a representation of the resource at the target URI.
 org.restlet.Response getRepresentation(java.lang.String resourceUri, org.restlet.data.MediaType acceptedMediaType)
          Returns a representation of the resource at the target URI.
 java.util.Comparator<org.restlet.representation.Representation> getRepresentationsComparator()
          Allows to sort the list of representations set by the resource.
 java.lang.String getTargetUri()
          Returns the context's target URI (file, clap URI).
 org.restlet.data.Reference getUniqueReference()
          Gets the uniqueReference value
 java.util.List<org.restlet.representation.Variant> getVariants()
           
 java.util.List<org.restlet.representation.Variant> getVariants(org.restlet.data.Method method)
          Returns the list of variants for the given method.
 java.util.List<org.restlet.representation.Variant> getVariantsGet()
          Gets the variantsGet value
 org.restlet.data.ReferenceList getVariantsReferences()
          Returns the references of the representations of the target resource according to the directory handler property
 org.restlet.representation.Representation handle()
           
 org.restlet.representation.Representation handleDelete()
          Handling the call for delete method using base handle
 boolean isDirectoryRedirection()
          Gets the directoryRedirection value
 boolean isDirectoryTarget()
          Indicates if the target resource is a directory.
 boolean isFileTarget()
          Indicates if the target resource is a file.
 org.restlet.representation.Representation post(org.restlet.representation.Representation entity)
           
 org.restlet.representation.Representation put(org.restlet.representation.Representation entity)
           
 void setBaseName(java.lang.String base)
          Set the base name
 void setBaseVariant(org.restlet.representation.Variant baseVariant)
          Sets the value of baseVariant
 void setDirectory(DirectoryProxy dir)
          Set the parent directory handler.
 void setDirectoryContent(org.restlet.data.ReferenceList dirContent)
          If the resource is a directory, this returns its content.
 void setDirectoryRedirection(boolean directoryRedirection)
          Sets the value of directoryRedirection
 void setDirectoryUri(java.lang.String dirUri)
          Returns the context's directory URI (file, clap URI).
 void setFileContent(org.restlet.representation.Representation fileContent)
          Sets the value of fileContent
 void setIfDirectoryTarget(boolean isDirTarget)
          Indicates if the target resource is a directory.
 void setIfFileTarget(boolean isFileTarget)
          Indicates if the target resource is a file.
 void setIndexName(java.lang.String indexName)
          Sets the value of indexName
 void setOriginalRef(org.restlet.data.Reference originalRef)
          Sets the value of originalRef
 void setProtoVariant(org.restlet.representation.Variant protoVariant)
          Sets the value of protoVariant
 void setRelativePart(java.lang.String relativePart)
          Sets the value of relativePart
 void setTargetUri(java.lang.String targetUri)
          Sets the context's target URI (file, clap URI).
 void setUniqueReference(org.restlet.data.Reference uniqueReference)
          Sets the value of uniqueReference
 void setVariantsGet(java.util.List<org.restlet.representation.Variant> variantsGet)
          Sets the value of variantsGet
 org.restlet.representation.Representation upload(org.restlet.representation.Representation entity)
          upload
 
Methods inherited from class org.restlet.resource.ServerResource
abort, commit, getOnSent, isAnnotated, isAutoCommitting, isCommitted, isConditional, isExisting, isInRole, isNegotiated, redirectPermanent, redirectPermanent, redirectSeeOther, redirectSeeOther, redirectTemporary, redirectTemporary, setAllowedMethods, setAnnotated, setAutoCommitting, setChallengeRequests, setCommitted, setConditional, setCookieSettings, setDimensions, setExisting, setLocationRef, setLocationRef, setNegotiated, setOnSent, setServerInfo, setStatus, setStatus, setStatus, setStatus, updateAllowedMethods
 
Methods inherited from class org.restlet.resource.UniformResource
getAllowedMethods, getApplication, getChallengeRequests, getChallengeResponse, getClientInfo, getConditions, getContext, getConverterService, getCookies, getCookieSettings, getDimensions, getHostRef, getLocationRef, getLogger, getMatrix, getMaxForwards, getMetadataService, getMethod, getProtocol, getQuery, getRanges, getReference, getReferrerRef, getRequest, getRequestAttributes, getRequestEntity, getResponse, getResponseAttributes, getResponseEntity, getRootRef, getServerInfo, getStatus, getStatusService, init, isConfidential, release, setRequest, setResponse
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDirectoryServerResource

public AbstractDirectoryServerResource()
Method Detail

getVariantsGet

public final java.util.List<org.restlet.representation.Variant> getVariantsGet()
Gets the variantsGet value

Returns:
the variantsGet

setVariantsGet

public final void setVariantsGet(java.util.List<org.restlet.representation.Variant> variantsGet)
Sets the value of variantsGet

Parameters:
variantsGet - the variantsGet to set

getFileContent

public final org.restlet.representation.Representation getFileContent()
Gets the fileContent value

Returns:
the fileContent

setFileContent

public final void setFileContent(org.restlet.representation.Representation fileContent)
Sets the value of fileContent

Parameters:
fileContent - the fileContent to set

getRelativePart

public final java.lang.String getRelativePart()
Gets the relativePart value

Returns:
the relativePart

setRelativePart

public final void setRelativePart(java.lang.String relativePart)
Sets the value of relativePart

Parameters:
relativePart - the relativePart to set

get

public final org.restlet.representation.Representation get()
Overrides:
get in class org.restlet.resource.ServerResource

getBaseName

public final java.lang.String getBaseName()
Returns the local base name of the file. For example, "foo.en" and "foo.en-GB.html" return "foo".

Returns:
The local name of the file.

setBaseName

public final void setBaseName(java.lang.String base)
Set the base name

Parameters:
base - the base name to set

getClientDispatcher

public final org.restlet.Client getClientDispatcher()
Returns a client dispatcher.

Returns:
A client dispatcher.

getDirectory

public final org.restlet.resource.Directory getDirectory()
Returns the parent directory handler.

Returns:
The parent directory handler.

setDirectory

public final void setDirectory(DirectoryProxy dir)
Set the parent directory handler.

Parameters:
dir - the directory to set

getDirectoryContent

public final org.restlet.data.ReferenceList getDirectoryContent()
If the resource is a directory, this returns its content.

Returns:
The directory content.

setDirectoryContent

public final void setDirectoryContent(org.restlet.data.ReferenceList dirContent)
If the resource is a directory, this returns its content.

Parameters:
dirContent - the directory content

getDirectoryUri

public final java.lang.String getDirectoryUri()
Returns the context's directory URI (file, clap URI).

Returns:
The context's directory URI (file, clap URI).

setDirectoryUri

public final void setDirectoryUri(java.lang.String dirUri)
Returns the context's directory URI (file, clap URI).

Parameters:
dirUri - set the directory URI

setTargetUri

public final void setTargetUri(java.lang.String targetUri)
Sets the context's target URI (file, clap URI).

Parameters:
targetUri - The context's target URI.

getRepresentation

public final org.restlet.Response getRepresentation(java.lang.String resourceUri)
Returns a representation of the resource at the target URI. Leverages the client dispatcher of the parent directory's context.

Parameters:
resourceUri - The URI of the target resource.
Returns:
A response with the representation if success.

getRepresentation

public final org.restlet.Response getRepresentation(java.lang.String resourceUri,
                                                    org.restlet.data.MediaType acceptedMediaType)
Returns a representation of the resource at the target URI. Leverages the client dispatcher of the parent directory's context.

Parameters:
resourceUri - The URI of the target resource.
acceptedMediaType - The accepted media type or null.
Returns:
A response with the representation if success.

getRepresentationsComparator

public final java.util.Comparator<org.restlet.representation.Representation> getRepresentationsComparator()
Allows to sort the list of representations set by the resource.

Returns:
A Comparator instance imposing a sort order of representations or null if no special order is wanted.

getTargetUri

public final java.lang.String getTargetUri()
Returns the context's target URI (file, clap URI).

Returns:
The context's target URI (file, clap URI).

getVariants

public final java.util.List<org.restlet.representation.Variant> getVariants()
Overrides:
getVariants in class org.restlet.resource.ServerResource

setIfDirectoryTarget

public final void setIfDirectoryTarget(boolean isDirTarget)
Indicates if the target resource is a directory.

Parameters:
isDirTarget - true if is a directory target

setIfFileTarget

public final void setIfFileTarget(boolean isFileTarget)
Indicates if the target resource is a file.

Parameters:
isFileTarget - true if is a file target

isDirectoryTarget

public final boolean isDirectoryTarget()
Indicates if the target resource is a directory.

Returns:
True if the target resource is a directory.

isFileTarget

public final boolean isFileTarget()
Indicates if the target resource is a file.

Returns:
True if the target resource is a file.

post

public final org.restlet.representation.Representation post(org.restlet.representation.Representation entity)
Overrides:
post in class org.restlet.resource.ServerResource

put

public final org.restlet.representation.Representation put(org.restlet.representation.Representation entity)
Overrides:
put in class org.restlet.resource.ServerResource

upload

public final org.restlet.representation.Representation upload(org.restlet.representation.Representation entity)
upload

Parameters:
entity - Representation
Returns:
Representation

handle

public org.restlet.representation.Representation handle()
Overrides:
handle in class org.restlet.resource.ServerResource

isDirectoryRedirection

public final boolean isDirectoryRedirection()
Gets the directoryRedirection value

Returns:
the directoryRedirection

setDirectoryRedirection

public final void setDirectoryRedirection(boolean directoryRedirection)
Sets the value of directoryRedirection

Parameters:
directoryRedirection - the directoryRedirection to set

getOriginalRef

public final org.restlet.data.Reference getOriginalRef()
Gets the originalRef value

Overrides:
getOriginalRef in class org.restlet.resource.UniformResource
Returns:
the originalRef

setOriginalRef

public final void setOriginalRef(org.restlet.data.Reference originalRef)
Sets the value of originalRef

Parameters:
originalRef - the originalRef to set

handleDelete

public final org.restlet.representation.Representation handleDelete()
Handling the call for delete method using base handle

Returns:
the representation according to the call

getVariantsReferences

public final org.restlet.data.ReferenceList getVariantsReferences()
Returns the references of the representations of the target resource according to the directory handler property

Returns:
The list of variants references

setUniqueReference

public final void setUniqueReference(org.restlet.data.Reference uniqueReference)
Sets the value of uniqueReference

Parameters:
uniqueReference - the uniqueReference to set

getUniqueReference

public final org.restlet.data.Reference getUniqueReference()
Gets the uniqueReference value

Returns:
the uniqueReference

setBaseVariant

public final void setBaseVariant(org.restlet.representation.Variant baseVariant)
Sets the value of baseVariant

Parameters:
baseVariant - the baseVariant to set

getBaseVariant

public final org.restlet.representation.Variant getBaseVariant()
Gets the baseVariant value

Returns:
the baseVariant

setProtoVariant

public final void setProtoVariant(org.restlet.representation.Variant protoVariant)
Sets the value of protoVariant

Parameters:
protoVariant - the protoVariant to set

getProtoVariant

public final org.restlet.representation.Variant getProtoVariant()
Gets the protoVariant value

Returns:
the protoVariant

getVariants

public java.util.List<org.restlet.representation.Variant> getVariants(org.restlet.data.Method method)
Returns the list of variants for the given method.

Overrides:
getVariants in class org.restlet.resource.ServerResource
Parameters:
method - The related method.
Returns:
The list of variants for the given method.
See Also:
DirectoryServerResource.getVariants(Method method)

getIndexName

public java.lang.String getIndexName()
Gets the indexName value

Returns:
the indexName

setIndexName

public void setIndexName(java.lang.String indexName)
Sets the value of indexName

Parameters:
indexName - the indexName to set


Copyright © 2010-2013 CNES. All Rights Reserved.