private ContextHandler createContextHandler(String directory,boolean isInJar,File installRootDirectory,int expiresInSeconds){
  final ContextHandler contextHandler=new ContextHandler();
  final ResourceHandler resourceHandler=new ExpiresResourceHandler(expiresInSeconds);
  final String directoryWithSlash="/" + directory;
  contextHandler.setContextPath(directoryWithSlash);
  Resource directoryResource=getDirectoryResource(directory,isInJar,installRootDirectory);
  directoryResource=new JsMinifyingResource(directoryResource);
  if (isInJar) {
    directoryResource=new CachingResource(directoryResource,directoryWithSlash);
  }
  resourceHandler.setBaseResource(directoryResource);
  if (!isInJar) {
    resourceHandler.setMinMemoryMappedContentLength(0);
  }
  contextHandler.setHandler(resourceHandler);
  return contextHandler;
}

private ContextHandler createContextHandler ( String directory , boolean isInJar , File installRootDirectory , int expiresInSeconds ) { final ContextHandler contextHandler = new ContextHandler ( ) ; final ResourceHandler resourceHandler = new ExpiresResourceHandler ( expiresInSeconds ) ; final String directoryWithSlash = "/" + directory ; contextHandler . setContextPath ( directoryWithSlash ) ; Resource directoryResource = getDirectoryResource ( directory , isInJar , installRootDirectory ) ; directoryResource = new JsMinifyingResource ( directoryResource ) ; if ( isInJar ) { directoryResource = new CachingResource ( directoryResource , directoryWithSlash ) ; } resourceHandler . setBaseResource ( directoryResource ) ; if ( ! isInJar ) { resourceHandler . setMinMemoryMappedContentLength ( 0 ) ; } contextHandler . setHandler ( resourceHandler ) ; return contextHandler ; }
creates a context handler for the directory .
