org.openqa.selenium.server
Class StaticContentHandler

java.lang.Object
  extended by org.openqa.jetty.http.handler.AbstractHttpHandler
      extended by org.openqa.jetty.http.handler.ResourceHandler
          extended by org.openqa.selenium.server.StaticContentHandler
All Implemented Interfaces:
java.io.Serializable, HttpHandler, LifeCycle

public class StaticContentHandler
extends ResourceHandler

See Also:
Serialized Form

Field Summary
static int SERVER_DELAY
           
 
Constructor Summary
StaticContentHandler(java.lang.String debugURL, boolean proxyInjectionMode)
           
 
Method Summary
 void addStaticContent(ResourceLocator locator)
           
protected  void callSuperHandle(java.lang.String pathInContext, java.lang.String pathParams, HttpRequest httpRequest, HttpResponse httpResponse)
           
protected  Resource getResource(java.lang.String pathInContext)
          get Resource to serve.
static boolean getSlowResources()
           
 void handle(java.lang.String pathInContext, java.lang.String pathParams, HttpRequest httpRequest, HttpResponse httpResponse)
          Handle a request.
 void sendData(HttpRequest request, HttpResponse response, java.lang.String pathInContext, Resource resource, boolean writeHeaders)
           
static void setSlowResources(boolean slowResources)
           
 
Methods inherited from class org.openqa.jetty.http.handler.ResourceHandler
getAllowedMethods, getAllowedString, getMinGzipLength, getRedirectWelcome, handleGet, isAcceptRanges, isDirAllowed, isMethodAllowed, setAcceptRanges, setAllowedMethods, setDirAllowed, setMinGzipLength, setRedirectWelcome, start, stop, writeHeaders
 
Methods inherited from class org.openqa.jetty.http.handler.AbstractHttpHandler
getHttpContext, getName, handleTrace, initialize, isStarted, setName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SERVER_DELAY

public static final int SERVER_DELAY
See Also:
Constant Field Values
Constructor Detail

StaticContentHandler

public StaticContentHandler(java.lang.String debugURL,
                            boolean proxyInjectionMode)
Method Detail

handle

public void handle(java.lang.String pathInContext,
                   java.lang.String pathParams,
                   HttpRequest httpRequest,
                   HttpResponse httpResponse)
            throws java.io.IOException
Description copied from interface: HttpHandler
Handle a request. Note that Handlers are tried in order until one has handled the request. i.e. until request.isHandled() returns true. In broad terms this means, either a response has been commited or request.setHandled(true) has been called.

Specified by:
handle in interface HttpHandler
Overrides:
handle in class ResourceHandler
Parameters:
pathInContext - The context path
pathParams - Path parameters such as encoded Session ID
httpRequest - The HttpRequest request
httpResponse - The HttpResponse response
Throws:
java.io.IOException

callSuperHandle

protected void callSuperHandle(java.lang.String pathInContext,
                               java.lang.String pathParams,
                               HttpRequest httpRequest,
                               HttpResponse httpResponse)
                        throws java.io.IOException
Throws:
java.io.IOException

getResource

protected Resource getResource(java.lang.String pathInContext)
                        throws java.io.IOException
Description copied from class: ResourceHandler
get Resource to serve. Map a path to a resource. The default implementation calls HttpContext.getResource but derived handers may provide their own mapping.

Overrides:
getResource in class ResourceHandler
Parameters:
pathInContext - The path to find a resource for.
Returns:
The resource to serve.
Throws:
java.io.IOException

addStaticContent

public void addStaticContent(ResourceLocator locator)

sendData

public void sendData(HttpRequest request,
                     HttpResponse response,
                     java.lang.String pathInContext,
                     Resource resource,
                     boolean writeHeaders)
              throws java.io.IOException
Overrides:
sendData in class ResourceHandler
Throws:
java.io.IOException

setSlowResources

public static void setSlowResources(boolean slowResources)

getSlowResources

public static boolean getSlowResources()


Copyright © 2011. All Rights Reserved.