org.restlet.engine.local
Class LocalClientHelper

java.lang.Object
  extended by org.restlet.engine.Helper
      extended by org.restlet.engine.RestletHelper<T>
          extended by org.restlet.engine.ConnectorHelper<Client>
              extended by org.restlet.engine.ClientHelper
                  extended by 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.

Author:
Jerome Louvel, Thierry Boileau
See Also:
LocalReference

Constructor Summary
LocalClientHelper(Client client)
          Constructor.
 
Method Summary
 String getDefaultLanguage()
          Returns the default language.
 int getTimeToLive()
          Returns the time to live for a file representation before it expires (in seconds).
 void handle(Request request, Response response)
          Handles a call.
protected abstract  void handleLocal(Request request, Response response, String decodedPath)
          Handles a local call.
 
Methods inherited from class org.restlet.engine.ClientHelper
getSocketConnectTimeoutMs
 
Methods inherited from class org.restlet.engine.ConnectorHelper
getConnectorService, getContext, getProtocols, start, stop, update
 
Methods inherited from class org.restlet.engine.RestletHelper
getAttributes, getHelped, getHelpedParameters, getLogger, getMetadataService, setHelped
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 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:
handle in class RestletHelper<Client>
Parameters:
request - The request to handle.
response - The response to update.

handleLocal

protected abstract void handleLocal(Request request,
                                    Response response,
                                    String decodedPath)
Handles a local call.

Parameters:
request - The request to handle.
response - The response to update.
decodedPath - The decoded local path.


Copyright © 2005-2013 Restlet.