Class HttpHandlerRegistration

java.lang.Object
org.glassfish.grizzly.http.server.HttpHandlerRegistration

public class HttpHandlerRegistration extends Object
Class representing HttpHandler registration information on a HttpServer. An instance of the class could be created either from String using fromString(java.lang.String) method, or builder builder().
Author:
Alexey Stashok
  • Field Details

  • Method Details

    • builder

      public static HttpHandlerRegistration.Builder builder()
      Returns:
      the HttpHandlerRegistration builder.
    • bulder

      Deprecated.
      typo :(
      Returns:
      the HttpHandlerRegistration builder.
    • fromString

      public static HttpHandlerRegistration fromString(String mapping)
      Create a registration from the mapping String. The part of the mapping before the second slash '/' occurrence will be treated as context-path and the remainder will be treated as a url-pattern. For example: 1) "" will be treated as context-path("") and url-pattern(""); 2) "/" will be treated as context-path("") and url-pattern("/"); 3) "/a/b/c" will be treated as context-path("/a") and url-pattern("/b/c"); 4) "/*" will be treated as context-path("") and url-pattern("/*") 5) "*.jpg" will be treated as context-path("") and url-pattern("*.jpg")
      Parameters:
      mapping - the String
      Returns:
      HttpHandlerRegistration
    • getContextPath

      public String getContextPath()
      Returns:
      context-path part of the registration
    • getUrlPattern

      public String getUrlPattern()
      Returns:
      url-pattern part of the registration
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object