Package org.restlet.engine.local
Class EntityClientHelper
java.lang.Object
org.restlet.engine.Helper
org.restlet.engine.RestletHelper<T>
org.restlet.engine.connector.ConnectorHelper<Client>
org.restlet.engine.connector.ClientHelper
org.restlet.engine.local.LocalClientHelper
org.restlet.engine.local.EntityClientHelper
- Direct Known Subclasses:
FileClientHelper
Connector to the local entities. That connector supports the content
negotiation feature (i.e. for GET and HEAD methods) and implements the
response to GET/HEAD methods.
- Author:
- Thierry Boileau
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateReference(String scheme, String encodedParentDirPath, String encodedEntityName, String decodedVariantName) Generate a Reference for a variant name (which is URL decoded) and handle the translation between the incoming requested path (which is URL encoded).abstract EntityReturns a local entity for the given path.protected StringgetReencodedVariantEntityName(String encodedEntityName, String decodedVariantEntityName) Percent-encodes the given percent-decoded variant name of a resource whose percent-encoded name is given.protected voidhandleEntityGet(Request request, Response response, Entity entity) Handles a GET call.protected voidhandleLocal(Request request, Response response, String decodedPath) Handles a local call.Methods inherited from class org.restlet.engine.local.LocalClientHelper
getDefaultLanguage, getTimeToLive, handleMethods inherited from class org.restlet.engine.connector.ConnectorHelper
getConnectorService, getContext, getProtocols, start, stop, updateMethods inherited from class org.restlet.engine.RestletHelper
getAttributes, getHelped, getHelpedParameters, getLogger, getMetadataService, setHelped
-
Constructor Details
-
EntityClientHelper
Constructor.- Parameters:
client- The client to help.
-
-
Method Details
-
createReference
public Reference createReference(String scheme, String encodedParentDirPath, String encodedEntityName, String decodedVariantName) Generate a Reference for a variant name (which is URL decoded) and handle the translation between the incoming requested path (which is URL encoded).- Parameters:
scheme- The scheme of the requested resource.encodedParentDirPath- The encoded path of the parent directory of the requested resource.encodedEntityName- The encoded name of the requested resource.decodedVariantName- The decoded name of a returned resource.- Returns:
- A new Reference.
-
getEntity
Returns a local entity for the given path.- Parameters:
path- The path of the entity.- Returns:
- A local entity for the given path.
-
getReencodedVariantEntityName
protected String getReencodedVariantEntityName(String encodedEntityName, String decodedVariantEntityName) Percent-encodes the given percent-decoded variant name of a resource whose percent-encoded name is given. Tries to match the longest common part of both encoded entity name and decoded variant name.- Parameters:
encodedEntityName- the percent-encoded name of the initial resourcedecodedVariantEntityName- the percent-decoded entity name of a variant of the initial resource.- Returns:
- The variant percent-encoded entity name.
-
handleEntityGet
Handles a GET call.- Parameters:
request- The request to answer.response- The response to update.entity- The requested entity (normal or directory).
-
handleLocal
Description copied from class:LocalClientHelperHandles a local call.- Specified by:
handleLocalin classLocalClientHelper- Parameters:
request- The request to handle.response- The response to update.decodedPath- The decoded local path.
-