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
public abstract class LocalClientHelper extends ClientHelper
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. - See Also:
LocalReference
-
-
Constructor Summary
Constructors Constructor Description LocalClientHelper(Client client)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDefaultLanguage()Returns the default language.intgetTimeToLive()Returns the time to live for a file representation before it expires (in seconds).voidhandle(Request request, Response response)Handles a call.protected abstract voidhandleLocal(Request request, Response response, java.lang.String decodedPath)Handles a local call.-
Methods inherited from class org.restlet.engine.connector.ConnectorHelper
getConnectorService, getContext, getProtocols, start, stop, update
-
Methods inherited from class org.restlet.engine.RestletHelper
getAttributes, getHelped, getHelpedParameters, getLogger, getMetadataService, setHelped
-
-
-
-
Constructor Detail
-
LocalClientHelper
public LocalClientHelper(Client client)
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 Detail
-
getDefaultLanguage
public java.lang.String 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
public final void handle(Request request, Response response)
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.
-
-