类 PathContainer

java.lang.Object
cn.taketoday.http.server.PathContainer
直接已知子类:
DefaultPathContainer, RequestPath

public abstract class PathContainer extends Object
Structured representation of a URI path parsed via parsePath(String) into a sequence of PathContainer.Separator and PathContainer.PathSegment elements.

Each PathContainer.PathSegment exposes its content in decoded form and with path parameters removed. This makes it safe to match one path segment at a time without the risk of decoded reserved characters altering the structure of the path.

从以下版本开始:
4.0
作者:
Rossen Stoyanchev
  • 构造器详细资料

    • PathContainer

      public PathContainer()
  • 方法详细资料

    • value

      public abstract String value()
      The original path from which this instance was parsed.
    • elements

      public abstract List<PathContainer.Element> elements()
      The contained path elements, either PathContainer.Separator or PathContainer.PathSegment.
    • subPath

      public PathContainer subPath(int index)
      Extract a sub-path from the given offset into the elements list.
      参数:
      index - the start element index (inclusive)
      返回:
      the sub-path
    • subPath

      public PathContainer subPath(int startIndex, int endIndex)
      Extract a sub-path from the given start offset into the element list (inclusive) and to the end offset (exclusive).
      参数:
      startIndex - the start element index (inclusive)
      endIndex - the end element index (exclusive)
      返回:
      the sub-path
    • parsePath

      public static PathContainer parsePath(String path)
      Parse the path value into a sequence of "/" Separator and PathSegment elements.
      参数:
      path - the encoded, raw path value to parse
      返回:
      the parsed path
    • parsePath

      public static PathContainer parsePath(String path, PathContainer.Options options)
      Parse the path value into a sequence of Separator and PathSegment elements.
      参数:
      path - the encoded, raw path value to parse
      options - to customize parsing
      返回:
      the parsed path