Class 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 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:
        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,
                                            java.lang.String decodedPath)
        Handles a local call.
        Parameters:
        request - The request to handle.
        response - The response to update.
        decodedPath - The decoded local path.