Class UrlTemplate

java.lang.Object
org.openqa.selenium.remote.http.UrlTemplate

public class UrlTemplate extends Object
A bad implementation of URL Templates, but enough for our needs.
  • Constructor Details

    • UrlTemplate

      public UrlTemplate(String template)
  • Method Details

    • match

      public @Nullable UrlTemplate.Match match(@Nullable String matchAgainst)
      Returns:
      A UrlTemplate.Match with all parameters filled if successful, null otherwise.
    • match

      public @Nullable UrlTemplate.Match match(@Nullable String matchAgainst, @Nullable String prefix)
      Matches a URL against this template after stripping a leading prefix.

      The prefix is treated literally (not as a regex) and stripped from the start of matchAgainst before matching, unless it is empty or "/".

      Parameters:
      matchAgainst - the URL (or path) to match against this template
      prefix - a literal prefix to strip from matchAgainst before matching
      Returns:
      a UrlTemplate.Match with all parameters filled if successful, null otherwise