Class SuffixPipeline

java.lang.Object
org.eclipse.jgit.http.server.glue.UrlPipeline
org.eclipse.jgit.http.server.glue.SuffixPipeline

class SuffixPipeline extends UrlPipeline
Selects requests by matching the suffix of the URI.

The suffix string is literally matched against the path info of the servlet request, as this class assumes it is invoked by MetaServlet. Suffix strings may include path components. Examples include /info/refs, or just simple extension matches like .txt.

When dispatching to the rest of the pipeline the HttpServletRequest is modified so that getPathInfo() does not contain the suffix that caused this pipeline to be selected.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    (package private) static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final String
     
    private final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    SuffixPipeline(String suffix, javax.servlet.Filter[] filters, javax.servlet.http.HttpServlet servlet)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) boolean
    match(javax.servlet.http.HttpServletRequest req)
    Determine if this pipeline handles the request's URL.
    (package private) void
    service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse rsp)
    Execute the filters and the servlet on the request.

    Methods inherited from class org.eclipse.jgit.http.server.glue.UrlPipeline

    destroy, init

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • suffix

      private final String suffix
    • suffixLen

      private final int suffixLen
  • Constructor Details

    • SuffixPipeline

      SuffixPipeline(String suffix, javax.servlet.Filter[] filters, javax.servlet.http.HttpServlet servlet)
  • Method Details

    • match

      boolean match(javax.servlet.http.HttpServletRequest req)
      Description copied from class: UrlPipeline
      Determine if this pipeline handles the request's URL.

      This method should match on the request's getPathInfo() method, as MetaServlet passes the request along as-is to each pipeline's match method.

      Specified by:
      match in class UrlPipeline
      Parameters:
      req - current HTTP request being considered by MetaServlet.
      Returns:
      true if this pipeline is configured to handle the request; false otherwise.
    • service

      void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse rsp) throws javax.servlet.ServletException, IOException
      Description copied from class: UrlPipeline
      Execute the filters and the servlet on the request.

      Invoked by MetaServlet once UrlPipeline.match(HttpServletRequest) has determined this pipeline is the correct pipeline to handle the current request.

      Overrides:
      service in class UrlPipeline
      Parameters:
      req - current HTTP request.
      rsp - current HTTP response.
      Throws:
      javax.servlet.ServletException - request cannot be completed.
      IOException - IO error prevents the request from being completed.
    • toString

      public String toString()
      Overrides:
      toString in class Object