runtime/local_jetty12_ee10/src/main/java/com/google/appengine/tools/development/jetty/ee10/StaticFileFilter.java [91:144]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
      throws ServletException, IOException {
    Boolean forwarded = (Boolean) request.getAttribute(LocalResourceFileServlet.__FORWARD_JETTY);
    if (forwarded == null) {
      forwarded = Boolean.FALSE;
    }

    Boolean included = (Boolean) request.getAttribute(LocalResourceFileServlet.__INCLUDE_JETTY);
    if (included == null) {
      included = Boolean.FALSE;
    }

    if (forwarded || included) {
      // If we're forwarded or included, the request is already in the
      // runtime and static file serving is not relevant.
      chain.doFilter(request, response);
      return;
    }

    HttpServletRequest httpRequest = (HttpServletRequest) request;
    HttpServletResponse httpResponse = (HttpServletResponse) response;
    String servletPath = httpRequest.getServletPath();
    String pathInfo = httpRequest.getPathInfo();
    String pathInContext = URIUtil.addPaths(servletPath, pathInfo);

    if (maybeServeWelcomeFile(pathInContext, httpRequest, httpResponse)) {
      // We served a welcome file.
      return;
    }

    // Find the resource
    Resource resource = null;
    try {
      resource = getResource(pathInContext);

      // Handle resource
      if (resource != null && resource.exists() && !resource.isDirectory()) {
        if (appEngineWebXml.includesStatic(resourceRoot + pathInContext)) {
          // passConditionalHeaders will set response headers, and
          // return true if we also need to send the content.
          if (staticFileUtils.passConditionalHeaders(httpRequest, httpResponse, resource)) {
            staticFileUtils.sendData(httpRequest, httpResponse, false, resource);
          }
          return;
        }
      }
    } finally {
      if (resource != null) {
        // TODO: how to release
        // resource.release();
      }
    }
    chain.doFilter(request, response);
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



runtime/local_jetty12/src/main/java/com/google/appengine/tools/development/jetty/StaticFileFilter.java [89:142]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
      throws ServletException, IOException {
    Boolean forwarded = (Boolean) request.getAttribute(LocalResourceFileServlet.__FORWARD_JETTY);
    if (forwarded == null) {
      forwarded = Boolean.FALSE;
    }

    Boolean included = (Boolean) request.getAttribute(LocalResourceFileServlet.__INCLUDE_JETTY);
    if (included == null) {
      included = Boolean.FALSE;
    }

    if (forwarded || included) {
      // If we're forwarded or included, the request is already in the
      // runtime and static file serving is not relevant.
      chain.doFilter(request, response);
      return;
    }

    HttpServletRequest httpRequest = (HttpServletRequest) request;
    HttpServletResponse httpResponse = (HttpServletResponse) response;
    String servletPath = httpRequest.getServletPath();
    String pathInfo = httpRequest.getPathInfo();
    String pathInContext = URIUtil.addPaths(servletPath, pathInfo);

    if (maybeServeWelcomeFile(pathInContext, httpRequest, httpResponse)) {
      // We served a welcome file.
      return;
    }

    // Find the resource
    Resource resource = null;
    try {
      resource = getResource(pathInContext);

      // Handle resource
      if (resource != null && resource.exists() && !resource.isDirectory()) {
        if (appEngineWebXml.includesStatic(resourceRoot + pathInContext)) {
          // passConditionalHeaders will set response headers, and
          // return true if we also need to send the content.
          if (staticFileUtils.passConditionalHeaders(httpRequest, httpResponse, resource)) {
            staticFileUtils.sendData(httpRequest, httpResponse, false, resource);
          }
          return;
        }
      }
    } finally {
      if (resource != null) {
        // TODO: how to release
        // resource.release();
      }
    }
    chain.doFilter(request, response);
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



