Package org.restlet.engine.local
Class LocalClientHelper
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
- Direct Known Subclasses:
ClapClientHelper,EntityClientHelper,ZipClientHelper
Connector to the local resources accessible via file system, class loaders
and similar mechanisms. Here is the list of parameters that are supported.
They should be set in the Client's context before it is started:
| Parameter name | Value type | Default value | Description |
|---|---|---|---|
| timeToLive | int | 600 | Time to live for a representation before it expires (in seconds). If you set the value to '0', the representation will never expire. |
| defaultLanguage | String | When no metadata service is available (simple client connector with no parent application), falls back on this default language. To indicate that no default language should be set, "" can be used. |
- Author:
- Jerome Louvel, Thierry Boileau
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the default language.intReturns the time to live for a file representation before it expires (in seconds).final voidHandles a call.protected abstract voidhandleLocal(Request request, Response response, String decodedPath) Handles a local call.Methods 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
-
LocalClientHelper
Constructor. Note that the common list of metadata associations based on extensions is added, see the addCommonExtensions() method.- Parameters:
client- The client to help.
-
-
Method Details
-
getDefaultLanguage
Returns the default language. When no metadata service is available (simple client connector with no parent application), falls back on this default language.- Returns:
- The default language.
-
getTimeToLive
public int getTimeToLive()Returns the time to live for a file representation before it expires (in seconds).- Returns:
- The time to live for a file representation before it expires (in seconds).
-
handle
Handles a call. Note that this implementation will systematically normalize and URI-decode the resource reference.- Overrides:
handlein classRestletHelper<Client>- Parameters:
request- The request to handle.response- The response to update.
-
handleLocal
Handles a local call.- Parameters:
request- The request to handle.response- The response to update.decodedPath- The decoded local path.
-