com.noelios.restlet.local
Class LocalClientHelper

java.lang.Object
  extended by org.restlet.util.Helper
      extended by com.noelios.restlet.ConnectorHelper
          extended by com.noelios.restlet.ClientHelper
              extended by com.noelios.restlet.local.LocalClientHelper
Direct Known Subclasses:
ClapClientHelper, FileClientHelper

public 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:

Parameter name Value type Default value Description
timeToLive int 600 Time to live for a file representation before it expires (in seconds).

Author:
Jerome Louvel (contact@noelios.com), Thierry Boileau
See Also:
LocalReference

Constructor Summary
LocalClientHelper(Client client)
          Constructor.
 
Method Summary
 MetadataService getMetadataService(Request request)
          Returns the metadata service associated to a request.
 int getTimeToLive()
          Returns the time to live for a file representation before it expires (in seconds).
 void updateMetadata(MetadataService metadataService, String entryName, Variant variant)
          Updates some variant metadata based on a given entry name with extensions.
 
Methods inherited from class com.noelios.restlet.ClientHelper
getClient, getContext, getLogger, getParameters
 
Methods inherited from class com.noelios.restlet.ConnectorHelper
createContext, getProtocols, handle, start, stop
 
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

getMetadataService

public MetadataService getMetadataService(Request request)
Returns the metadata service associated to a request.

Parameters:
request - The request to lookup.
Returns:
The metadata service associated to a request.

updateMetadata

public void updateMetadata(MetadataService metadataService,
                           String entryName,
                           Variant variant)
Updates some variant metadata based on a given entry name with extensions.

Parameters:
metadataService - The parent metadata service.
entryName - The entry name with extensions.
variant - The variant to update.

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).


Copyright © 2005-2007 Noelios Consulting.