marytts.tools.perceptiontest
Class FileDataRequestHandler

java.lang.Object
  extended by org.apache.http.nio.protocol.SimpleNHttpRequestHandler
      extended by marytts.server.http.BaseHttpRequestHandler
          extended by marytts.tools.perceptiontest.FileDataRequestHandler
All Implemented Interfaces:
org.apache.http.nio.protocol.NHttpRequestHandler, org.apache.http.protocol.HttpRequestHandler

public class FileDataRequestHandler
extends BaseHttpRequestHandler

Processor class for file http requests to perception test server

Author:
Sathish Pammi and Oytun Türk

Field Summary
 
Fields inherited from class marytts.server.http.BaseHttpRequestHandler
logger
 
Constructor Summary
FileDataRequestHandler()
           
 
Method Summary
 void handle(org.apache.http.HttpRequest request, org.apache.http.HttpResponse response, org.apache.http.protocol.HttpContext context)
          The entry point of all HttpRequestHandlers.
protected  void handleClientRequest(java.lang.String absPath, java.util.Map<java.lang.String,java.lang.String> queryItems, org.apache.http.HttpResponse response, Address serverAddressAtClient)
           
 
Methods inherited from class marytts.server.http.BaseHttpRequestHandler
entityRequest, getAudioEffectDefaultParam, getAudioEffectHelpText, getAudioFileFormatTypes, getDataTypes, getDefaultAudioEffects, getDefaultVoiceExampleTexts, getDefaultVoiceName, getExampleText, getFullAudioEffect, getMaryVersion, getServerAddressAtClient, getVocalizations, getVoiceExampleText, getVoices, isHmmAudioEffect
 
Methods inherited from class org.apache.http.nio.protocol.SimpleNHttpRequestHandler
handle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileDataRequestHandler

public FileDataRequestHandler()
Method Detail

handle

public void handle(org.apache.http.HttpRequest request,
                   org.apache.http.HttpResponse response,
                   org.apache.http.protocol.HttpContext context)
The entry point of all HttpRequestHandlers. When this method returns, the response is sent to the client. We override this here to show how simple a processing we are doing for file requests.

Specified by:
handle in interface org.apache.http.protocol.HttpRequestHandler
Overrides:
handle in class BaseHttpRequestHandler

handleClientRequest

protected void handleClientRequest(java.lang.String absPath,
                                   java.util.Map<java.lang.String,java.lang.String> queryItems,
                                   org.apache.http.HttpResponse response,
                                   Address serverAddressAtClient)
                            throws java.io.IOException
Specified by:
handleClientRequest in class BaseHttpRequestHandler
Throws:
java.io.IOException