akka.http.scaladsl.server.directives

PathDirectives

trait PathDirectives extends PathMatchers with ImplicitPathMatcherConstruction with ToNameReceptacleEnhancements

Source
PathDirectives.scala
Linear Supertypes
ToNameReceptacleEnhancements, ImplicitPathMatcherConstruction, PathMatchers, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. PathDirectives
  2. ToNameReceptacleEnhancements
  3. ImplicitPathMatcherConstruction
  4. PathMatchers
  5. AnyRef
  6. Any
Implicitly
  1. by any2stringadd
  2. by any2stringfmt
  3. by any2ArrowAssoc
  4. by any2Ensuring
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. abstract class NumberMatcher[T] extends PathMatcher1[T]

    Definition Classes
    PathMatchers

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def +(other: String): String

    Implicit information
    This member is added by an implicit conversion from PathDirectives to StringAdd performed by method any2stringadd in scala.Predef.
    Definition Classes
    StringAdd
  5. def ->[B](y: B): (PathDirectives, B)

    Implicit information
    This member is added by an implicit conversion from PathDirectives to ArrowAssoc[PathDirectives] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  6. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  7. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  8. val DoubleNumber: PathMatcher1[Double]

    A PathMatcher that matches and extracts a Double value.

    A PathMatcher that matches and extracts a Double value. The matched string representation is the pure decimal, optionally signed form of a double value, i.e. without exponent.

    Definition Classes
    PathMatchers
  9. object HexIntNumber extends NumberMatcher[Int]

    A PathMatcher that efficiently matches a number of hex-digits and extracts their (non-negative) Int value.

  10. object HexLongNumber extends NumberMatcher[Long]

    A PathMatcher that efficiently matches a number of hex-digits and extracts their (non-negative) Long value.

  11. object IntNumber extends NumberMatcher[Int]

    A PathMatcher that efficiently matches a number of digits and extracts their (non-negative) Int value.

  12. val JavaUUID: PathMatcher1[UUID]

    A PathMatcher that matches and extracts a java.

    A PathMatcher that matches and extracts a java.util.UUID instance.

    Definition Classes
    PathMatchers
  13. object LongNumber extends NumberMatcher[Long]

    A PathMatcher that efficiently matches a number of digits and extracts their (non-negative) Long value.

  14. val Neutral: PathMatcher0

    A PathMatcher that always matches, doesn't consume anything and extracts nothing.

    A PathMatcher that always matches, doesn't consume anything and extracts nothing. Serves mainly as a neutral element in PathMatcher composition.

    Definition Classes
    PathMatchers
  15. object PathEnd extends PathMatcher0

    A PathMatcher that matches the very end of the requests URI path.

  16. object Rest extends PathMatcher1[String]

    A PathMatcher that matches and extracts the complete remaining, unmatched part of the request's URI path as an (encoded!) String.

  17. object RestPath extends PathMatcher1[Path]

    A PathMatcher that matches and extracts the complete remaining, unmatched part of the request's URI path.

  18. object Segment extends PathMatcher1[String]

    A PathMatcher that matches if the unmatched path starts with a path segment.

  19. def Segments(min: Int, max: Int): PathMatcher1[List[String]]

    A PathMatcher that matches between min and max (both inclusively) path segments (separated by slashes) as a List[String].

    A PathMatcher that matches between min and max (both inclusively) path segments (separated by slashes) as a List[String]. If there are more than count segments present the remaining ones will be left unmatched. If the path has a trailing slash this slash will *not* be matched.

    Definition Classes
    PathMatchers
  20. def Segments(count: Int): PathMatcher1[List[String]]

    A PathMatcher that matches the given number of path segments (separated by slashes) as a List[String].

    A PathMatcher that matches the given number of path segments (separated by slashes) as a List[String]. If there are more than count segments present the remaining ones will be left unmatched. If the path has a trailing slash this slash will *not* be matched.

    Definition Classes
    PathMatchers
  21. val Segments: PathMatcher1[List[String]]

    A PathMatcher that matches up to 128 remaining segments as a List[String].

    A PathMatcher that matches up to 128 remaining segments as a List[String]. This can also be no segments resulting in the empty list. If the path has a trailing slash this slash will *not* be matched.

    Definition Classes
    PathMatchers
  22. object Slash extends PathMatcher0

    A PathMatcher that matches a single slash character ('/').

  23. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  24. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. def ensuring(cond: (PathDirectives) ⇒ Boolean, msg: ⇒ Any): PathDirectives

    Implicit information
    This member is added by an implicit conversion from PathDirectives to Ensuring[PathDirectives] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  26. def ensuring(cond: (PathDirectives) ⇒ Boolean): PathDirectives

    Implicit information
    This member is added by an implicit conversion from PathDirectives to Ensuring[PathDirectives] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  27. def ensuring(cond: Boolean, msg: ⇒ Any): PathDirectives

    Implicit information
    This member is added by an implicit conversion from PathDirectives to Ensuring[PathDirectives] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  28. def ensuring(cond: Boolean): PathDirectives

    Implicit information
    This member is added by an implicit conversion from PathDirectives to Ensuring[PathDirectives] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  29. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  30. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  31. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  32. def formatted(fmtstr: String): String

    Implicit information
    This member is added by an implicit conversion from PathDirectives to StringFormat performed by method any2stringfmt in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  33. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  34. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  35. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  36. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  37. def nothingMatcher[L](implicit arg0: Tuple[L]): PathMatcher[L]

    A PathMatcher that never matches anything.

    A PathMatcher that never matches anything.

    Definition Classes
    PathMatchers
  38. final def notify(): Unit

    Definition Classes
    AnyRef
  39. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  40. def path[L](pm: PathMatcher[L]): Directive[L]

    Applies the given PathMatcher to the remaining unmatched path after consuming a leading slash.

    Applies the given PathMatcher to the remaining unmatched path after consuming a leading slash. The matcher has to match the remaining path completely. If matched the value extracted by the PathMatcher is extracted on the directive level.

  41. def pathEnd: Directive0

    Rejects the request if the unmatchedPath of the RequestContext is non-empty, or said differently: only passes on the request to its inner route if the request path has been matched completely.

  42. def pathEndOrSingleSlash: Directive0

    Only passes on the request to its inner route if the request path has been matched completely or only consists of exactly one remaining slash.

    Only passes on the request to its inner route if the request path has been matched completely or only consists of exactly one remaining slash.

    Note that trailing slash and non-trailing slash URLs are not the same, although they often serve the same content. It is recommended to serve only one URL version and make the other redirect to it using redirectToTrailingSlashIfMissing or redirectToNoTrailingSlashIfPresent directive.

    For example:

    def route = {
    // redirect '/users/' to '/users', '/users/:userId/' to '/users/:userId'
    redirectToNoTrailingSlashIfPresent(Found) {
      pathPrefix("users") {
        pathEnd {
          // user list ...
        } ~
        path(UUID) { userId =>
          // user profile ...
        }
      }
    }
    }

    For further information, refer to: http://googlewebmastercentral.blogspot.de/2010/04/to-slash-or-not-to-slash.html

  43. def pathPrefix[L](pm: PathMatcher[L]): Directive[L]

    Applies the given PathMatcher to a prefix of the remaining unmatched path after consuming a leading slash.

    Applies the given PathMatcher to a prefix of the remaining unmatched path after consuming a leading slash. The matcher has to match a prefix of the remaining path. If matched the value extracted by the PathMatcher is extracted on the directive level.

  44. def pathPrefixTest[L](pm: PathMatcher[L]): Directive[L]

    Checks whether the unmatchedPath of the RequestContext has a prefix matched by the given PathMatcher.

    Checks whether the unmatchedPath of the RequestContext has a prefix matched by the given PathMatcher. In analogy to the pathPrefix directive a leading slash is implied.

  45. def pathSingleSlash: Directive0

    Only passes on the request to its inner route if the request path consists of exactly one remaining slash.

  46. def pathSuffix[L](pm: PathMatcher[L]): Directive[L]

    Applies the given PathMatcher to a suffix of the remaining unmatchedPath of the RequestContext.

    Applies the given PathMatcher to a suffix of the remaining unmatchedPath of the RequestContext. If matched the value extracted by the PathMatcher is extracted and the matched parts of the path are consumed. Note that, for efficiency reasons, the given PathMatcher must match the desired suffix in reversed-segment order, i.e. pathSuffix("baz" / "bar") would match /foo/bar/baz!

  47. def pathSuffixTest[L](pm: PathMatcher[L]): Directive[L]

    Checks whether the unmatchedPath of the RequestContext has a suffix matched by the given PathMatcher.

    Checks whether the unmatchedPath of the RequestContext has a suffix matched by the given PathMatcher. However, as opposed to the pathSuffix directive the matched path is not actually "consumed". Note that, for efficiency reasons, the given PathMatcher must match the desired suffix in reversed-segment order, i.e. pathSuffixTest("baz" / "bar") would match /foo/bar/baz!

  48. def rawPathPrefix[L](pm: PathMatcher[L]): Directive[L]

    Applies the given matcher directly to a prefix of the unmatched path of the RequestContext (i.

    Applies the given matcher directly to a prefix of the unmatched path of the RequestContext (i.e. without implicitly consuming a leading slash). The matcher has to match a prefix of the remaining path. If matched the value extracted by the PathMatcher is extracted on the directive level.

  49. def rawPathPrefixTest[L](pm: PathMatcher[L]): Directive[L]

    Checks whether the unmatchedPath of the RequestContext has a prefix matched by the given PathMatcher.

    Checks whether the unmatchedPath of the RequestContext has a prefix matched by the given PathMatcher. However, as opposed to the pathPrefix directive the matched path is not actually "consumed".

  50. def redirectToNoTrailingSlashIfPresent(redirectionType: Redirection): Directive0

    If the request path ends with a slash, redirect to the same uri without trailing slash in the path.

    If the request path ends with a slash, redirect to the same uri without trailing slash in the path.

    Caveat: pathSingleSlash directive will not match inside of this directive.

  51. def redirectToTrailingSlashIfMissing(redirectionType: Redirection): Directive0

    If the request path doesn't end with a slash, redirect to the same uri with trailing slash in the path.

    If the request path doesn't end with a slash, redirect to the same uri with trailing slash in the path.

    Caveat: path without trailing slash and pathEnd directives will not match inside of this directive.

  52. implicit def regex2PathMatcher(regex: Regex): PathMatcher1[String]

    Creates a PathMatcher that consumes (a prefix of) the first path segment if the path begins with a segment (a prefix of) which matches the given regex.

    Creates a PathMatcher that consumes (a prefix of) the first path segment if the path begins with a segment (a prefix of) which matches the given regex. Extracts either the complete match (if the regex doesn't contain a capture group) or the capture group (if the regex contains exactly one). If the regex contains more than one capture group the method throws an IllegalArgumentException.

    Definition Classes
    ImplicitPathMatcherConstruction
  53. implicit def segmentStringToPathMatcher(segment: String): PathMatcher0

    Creates a PathMatcher that consumes (a prefix of) the first path segment (if the path begins with a segment).

    Creates a PathMatcher that consumes (a prefix of) the first path segment (if the path begins with a segment).

    Definition Classes
    ImplicitPathMatcherConstruction
  54. def separateOnSlashes(string: String): PathMatcher0

    Converts a path string containing slashes into a PathMatcher that interprets slashes as path segment separators.

    Converts a path string containing slashes into a PathMatcher that interprets slashes as path segment separators.

    Definition Classes
    PathMatchers
  55. implicit def string2NR(string: String): NameReceptacle[String]

    Definition Classes
    ToNameReceptacleEnhancements
  56. implicit def stringExtractionPair2PathMatcher[T](tuple: (String, T)): PathMatcher1[T]

    Creates a PathMatcher that consumes (a prefix of) the first path segment (if the path begins with a segment) and extracts a given value.

    Creates a PathMatcher that consumes (a prefix of) the first path segment (if the path begins with a segment) and extracts a given value.

    Definition Classes
    ImplicitPathMatcherConstruction
  57. implicit def stringNameOptionReceptacle2PathMatcher(nr: NameOptionReceptacle[String]): PathMatcher0

  58. implicit def symbol2NR(symbol: Symbol): NameReceptacle[String]

    Definition Classes
    ToNameReceptacleEnhancements
  59. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  60. def toString(): String

    Definition Classes
    AnyRef → Any
  61. implicit def valueMap2PathMatcher[T](valueMap: Map[String, T]): PathMatcher1[T]

    Creates a PathMatcher from the given Map of path segments (prefixes) to extracted values.

    Creates a PathMatcher from the given Map of path segments (prefixes) to extracted values. If the unmatched path starts with a segment having one of the maps keys as a prefix the matcher consumes this path segment (prefix) and extracts the corresponding map value.

    Definition Classes
    ImplicitPathMatcherConstruction
  62. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  63. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  64. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  65. def [B](y: B): (PathDirectives, B)

    Implicit information
    This member is added by an implicit conversion from PathDirectives to ArrowAssoc[PathDirectives] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Shadowed Implicit Value Members

  1. val self: Any

    Implicit information
    This member is added by an implicit conversion from PathDirectives to StringAdd performed by method any2stringadd in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (pathDirectives: StringAdd).self
    Definition Classes
    StringAdd
  2. val self: Any

    Implicit information
    This member is added by an implicit conversion from PathDirectives to StringFormat performed by method any2stringfmt in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (pathDirectives: StringFormat).self
    Definition Classes
    StringFormat

Deprecated Value Members

  1. def x: PathDirectives

    Implicit information
    This member is added by an implicit conversion from PathDirectives to ArrowAssoc[PathDirectives] performed by method any2ArrowAssoc in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (pathDirectives: ArrowAssoc[PathDirectives]).x
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use leftOfArrow instead

  2. def x: PathDirectives

    Implicit information
    This member is added by an implicit conversion from PathDirectives to Ensuring[PathDirectives] performed by method any2Ensuring in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (pathDirectives: Ensuring[PathDirectives]).x
    Definition Classes
    Ensuring
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use resultOfEnsuring instead

Inherited from ToNameReceptacleEnhancements

Inherited from PathMatchers

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from PathDirectives to StringAdd

Inherited by implicit conversion any2stringfmt from PathDirectives to StringFormat

Inherited by implicit conversion any2ArrowAssoc from PathDirectives to ArrowAssoc[PathDirectives]

Inherited by implicit conversion any2Ensuring from PathDirectives to Ensuring[PathDirectives]

Ungrouped