Class PathMappings<E>

java.lang.Object
org.eclipse.jetty.http.pathmap.PathMappings<E>
Type Parameters:
E - the type of mapping endpoint
All Implemented Interfaces:
Iterable<MappedResource<E>>, Dumpable

@ManagedObject("Path Mappings") public class PathMappings<E> extends Object implements Iterable<MappedResource<E>>, Dumpable
Path Mappings of PathSpec to Resource.

Sorted into search order upon entry into the Set

  • Constructor Details

    • PathMappings

      public PathMappings()
  • Method Details

    • dump

      public String dump()
      Specified by:
      dump in interface Dumpable
    • dump

      public void dump(Appendable out, String indent) throws IOException
      Description copied from interface: Dumpable
      Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.
      Specified by:
      dump in interface Dumpable
      Parameters:
      out - The appendable to dump to
      indent - The indent to apply after any new lines.
      Throws:
      IOException - if unable to write to Appendable
    • getMappings

      @ManagedAttribute(value="mappings", readonly=true) public List<MappedResource<E>> getMappings()
    • size

      public int size()
    • reset

      public void reset()
    • removeIf

      public void removeIf(Predicate<MappedResource<E>> predicate)
    • getMatchedList

      public List<MatchedResource<E>> getMatchedList(String path)
      Return a list of MatchedResource matches for the specified path.
      Parameters:
      path - the path to return matches on
      Returns:
      the list of mapped resource the path matches on
    • getMatches

      public List<MappedResource<E>> getMatches(String path)
      Return a list of MappedResource matches for the specified path.
      Parameters:
      path - the path to return matches on
      Returns:
      the list of mapped resource the path matches on
    • getMatched

      public MatchedResource<E> getMatched(String path)

      Find the best single match for a path.

      The match may be found by optimized direct lookups when possible, otherwise all mappings are iterated over and the first match returned

      Parameters:
      path - The path to match
      Returns:
      A MatchedResource instance or null if no mappings matched.
      See Also:
      • getMatchedIteratively(String)
    • getMatch

      @Deprecated(forRemoval=true) public MappedResource<E> getMatch(String path)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use getMatched(String) instead
    • iterator

      public Iterator<MappedResource<E>> iterator()
      Specified by:
      iterator in interface Iterable<E>
    • asPathSpec

      @Deprecated(forRemoval=true) public static PathSpec asPathSpec(String pathSpecString)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • get

      public E get(PathSpec spec)
    • put

      public boolean put(String pathSpecString, E resource)
    • put

      public boolean put(PathSpec pathSpec, E resource)
    • remove

      public boolean remove(PathSpec pathSpec)
    • toString

      public String toString()
      Overrides:
      toString in class Object