controllers

ExternalAssets

object ExternalAssets extends Controller

Controller that serves static resources from an external folder. It useful in development mode if you want to serve static assets that shouldn't be part of the build process.

Not that this controller is not intented to be used in production mode and can lead to security issues. Therefore it is automatically disabled in production mode.

All assets are served with max-age=3600 cache directive.

You can use this controller in any application, just by declaring the appropriate route. For example:

GET     /assets/*file               controllers.ExternalAssets.at(path="/home/peter/myplayapp/external", file)
GET     /assets/*file               controllers.ExternalAssets.at(path="C:\external", file)
GET     /assets/*file               controllers.ExternalAssets.at(path="relativeToYourApp", file)
Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. ExternalAssets
  2. Controller
  3. RequestExtractors
  4. AcceptExtractors
  5. ContentTypes
  6. HeaderNames
  7. Status
  8. BodyParsers
  9. Results
  10. AnyRef
  11. Any
Visibility
  1. Public
  2. All

Type Members

  1. class Status extends SimpleResult[EmptyContent]

    Generates default SimpleResult from a content type, headers and content.

Value Members

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

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

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

    Attributes
    final
    Definition Classes
    AnyRef → Any
  4. object & extends AnyRef

    Convenient extractor allowing to apply two extractors.

  5. def == (arg0: AnyRef): Boolean

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

    Attributes
    final
    Definition Classes
    Any
  7. val ACCEPT : String

    Definition Classes
    HeaderNames
  8. val ACCEPTED : Int

    Definition Classes
    Status
  9. val ACCEPT_CHARSET : String

    Definition Classes
    HeaderNames
  10. val ACCEPT_ENCODING : String

    Definition Classes
    HeaderNames
  11. val ACCEPT_LANGUAGE : String

    Definition Classes
    HeaderNames
  12. val ACCEPT_RANGES : String

    Definition Classes
    HeaderNames
  13. val AGE : String

    Definition Classes
    HeaderNames
  14. val ALLOW : String

    Definition Classes
    HeaderNames
  15. val AUTHORIZATION : String

    Definition Classes
    HeaderNames
  16. val AbsolutePath : Regex

  17. val Accepted : Status

    Generates a ‘202 ACCEPTED’ result.

    Generates a ‘202 ACCEPTED’ result.

    Definition Classes
    Results
  18. object Accepts extends AnyRef

    Common extractors to check if a request accepts JSON, Html, etc.

  19. def Async (promise: Promise[Result]): AsyncResult

    Definition Classes
    Results
  20. val BAD_GATEWAY : Int

    Definition Classes
    Status
  21. val BAD_REQUEST : Int

    Definition Classes
    Status
  22. val BINARY : String

    Content-Type of binary data.

    Content-Type of binary data.

    Definition Classes
    ContentTypes
  23. val BadRequest : Status

    Generates a ‘400 BAD_REQUEST’ result.

    Generates a ‘400 BAD_REQUEST’ result.

    Definition Classes
    Results
  24. val CACHE_CONTROL : String

    Definition Classes
    HeaderNames
  25. val CONFLICT : Int

    Definition Classes
    Status
  26. val CONNECTION : String

    Definition Classes
    HeaderNames
  27. val CONTENT_DISPOSITION : String

    Definition Classes
    HeaderNames
  28. val CONTENT_ENCODING : String

    Definition Classes
    HeaderNames
  29. val CONTENT_LANGUAGE : String

    Definition Classes
    HeaderNames
  30. val CONTENT_LENGTH : String

    Definition Classes
    HeaderNames
  31. val CONTENT_LOCATION : String

    Definition Classes
    HeaderNames
  32. val CONTENT_MD5 : String

    Definition Classes
    HeaderNames
  33. val CONTENT_RANGE : String

    Definition Classes
    HeaderNames
  34. val CONTENT_TRANSFER_ENCODING : String

    Definition Classes
    HeaderNames
  35. val CONTENT_TYPE : String

    Definition Classes
    HeaderNames
  36. val CONTINUE : Int

    Definition Classes
    Status
  37. val COOKIE : String

    Definition Classes
    HeaderNames
  38. val CREATED : Int

    Definition Classes
    Status
  39. def CSS (implicit codec: Codec): String

    Content-Type of css according the implicit codec value.

    Content-Type of css according the implicit codec value.

    Definition Classes
    ContentTypes
  40. val Conflict : Status

    Generates a ‘409 CONFLICT’ result.

    Generates a ‘409 CONFLICT’ result.

    Definition Classes
    Results
  41. val Created : Status

    Generates a ‘201 CREATED’ result.

    Generates a ‘201 CREATED’ result.

    Definition Classes
    Results
  42. val DATE : String

    Definition Classes
    HeaderNames
  43. val ETAG : String

    Definition Classes
    HeaderNames
  44. def EVENT_STREAM (implicit codec: Codec): String

    Content-Type of server sent events according the implicit codec value

    Content-Type of server sent events according the implicit codec value

    Definition Classes
    ContentTypes
  45. val EXPECT : String

    Definition Classes
    HeaderNames
  46. val EXPECTATION_FAILED : Int

    Definition Classes
    Status
  47. val EXPIRES : String

    Definition Classes
    HeaderNames
  48. val EntityTooLarge : Status

    Generates a ‘413 REQUEST_ENTITY_TOO_LARGE’ result.

    Generates a ‘413 REQUEST_ENTITY_TOO_LARGE’ result.

    Definition Classes
    Results
  49. val ExpectationFailed : Status

    Generates a ‘417 EXPECTATION_FAILED’ result.

    Generates a ‘417 EXPECTATION_FAILED’ result.

    Definition Classes
    Results
  50. val FORBIDDEN : Int

    Definition Classes
    Status
  51. def FORM (implicit codec: Codec): String

    Content-Type of form-urlencoded according the implicit codec value.

    Content-Type of form-urlencoded according the implicit codec value.

    Definition Classes
    ContentTypes
  52. val FOUND : Int

    Definition Classes
    Status
  53. val FROM : String

    Definition Classes
    HeaderNames
  54. val Forbidden : Status

    Generates a ‘403 FORBIDDEN’ result.

    Generates a ‘403 FORBIDDEN’ result.

    Definition Classes
    Results
  55. def Found (url: String): SimpleResult[EmptyContent]

    Generates a ‘302 FOUND’ simple result.

    Generates a ‘302 FOUND’ simple result.

    url

    the URL to redirect to

    Definition Classes
    Results
  56. val GATEWAY_TIMEOUT : Int

    Definition Classes
    Status
  57. val GONE : Int

    Definition Classes
    Status
  58. val Gone : Status

    Generates a ‘410 GONE’ result.

    Generates a ‘410 GONE’ result.

    Definition Classes
    Results
  59. val HOST : String

    Definition Classes
    HeaderNames
  60. def HTML (implicit codec: Codec): String

    Content-Type of html according the implicit codec value.

    Content-Type of html according the implicit codec value.

    Definition Classes
    ContentTypes
  61. val HTTP_VERSION_NOT_SUPPORTED : Int

    Definition Classes
    Status
  62. val IF_MATCH : String

    Definition Classes
    HeaderNames
  63. val IF_MODIFIED_SINCE : String

    Definition Classes
    HeaderNames
  64. val IF_NONE_MATCH : String

    Definition Classes
    HeaderNames
  65. val IF_RANGE : String

    Definition Classes
    HeaderNames
  66. val IF_UNMODIFIED_SINCE : String

    Definition Classes
    HeaderNames
  67. val INTERNAL_SERVER_ERROR : Int

    Definition Classes
    Status
  68. val InternalServerError : Status

    Generates a ‘500 INTERNAL_SERVER_ERROR’ result.

    Generates a ‘500 INTERNAL_SERVER_ERROR’ result.

    Definition Classes
    Results
  69. def JAVASCRIPT (implicit codec: Codec): String

    Content-Type of javascript according the implicit codec value.

    Content-Type of javascript according the implicit codec value.

    Definition Classes
    ContentTypes
  70. def JSON (implicit codec: Codec): String

    Content-Type of json according the implicit codec value.

    Content-Type of json according the implicit codec value.

    Definition Classes
    ContentTypes
  71. val LAST_MODIFIED : String

    Definition Classes
    HeaderNames
  72. val LENGTH_REQUIRED : Int

    Definition Classes
    Status
  73. val LOCATION : String

    Definition Classes
    HeaderNames
  74. val MAX_FORWARDS : String

    Definition Classes
    HeaderNames
  75. val METHOD_NOT_ALLOWED : Int

    Definition Classes
    Status
  76. val MOVED_PERMANENTLY : Int

    Definition Classes
    Status
  77. val MULTIPLE_CHOICES : Int

    Definition Classes
    Status
  78. val MethodNotAllowed : Status

    Generates a ‘405 METHOD_NOT_ALLOWED’ result.

    Generates a ‘405 METHOD_NOT_ALLOWED’ result.

    Definition Classes
    Results
  79. def MovedPermanently (url: String): SimpleResult[EmptyContent]

    Generates a ‘301 MOVED_PERMANENTLY’ simple result.

    Generates a ‘301 MOVED_PERMANENTLY’ simple result.

    url

    the URL to redirect to

    Definition Classes
    Results
  80. val NON_AUTHORITATIVE_INFORMATION : Int

    Definition Classes
    Status
  81. val NOT_ACCEPTABLE : Int

    Definition Classes
    Status
  82. val NOT_FOUND : Int

    Definition Classes
    Status
  83. val NOT_IMPLEMENTED : Int

    Definition Classes
    Status
  84. val NOT_MODIFIED : Int

    Definition Classes
    Status
  85. val NO_CONTENT : Int

    Definition Classes
    Status
  86. val NoContent : SimpleResult[EmptyContent]

    Generates a ‘204 NO_CONTENT’ result.

    Generates a ‘204 NO_CONTENT’ result.

    Definition Classes
    Results
  87. val NonAuthoritativeInformation : Status

    Generates a ‘203 NON_AUTHORITATIVE_INFORMATION’ result.

    Generates a ‘203 NON_AUTHORITATIVE_INFORMATION’ result.

    Definition Classes
    Results
  88. val NotAcceptable : Status

    Generates a ‘406 NOT_ACCEPTABLE’ result.

    Generates a ‘406 NOT_ACCEPTABLE’ result.

    Definition Classes
    Results
  89. val NotFound : Status

    Generates a ‘404 NOT_FOUND’ result.

    Generates a ‘404 NOT_FOUND’ result.

    Definition Classes
    Results
  90. val NotImplemented : Status

    Generates a ‘501 NOT_IMPLEMENTED’ result.

    Generates a ‘501 NOT_IMPLEMENTED’ result.

    Definition Classes
    Results
  91. val NotModified : SimpleResult[EmptyContent]

    Generates a ‘304 NOT_MODIFIED’ result.

    Generates a ‘304 NOT_MODIFIED’ result.

    Definition Classes
    Results
  92. val OK : Int

    Definition Classes
    Status
  93. val Ok : Status

    Generates a ‘200 OK’ result.

    Generates a ‘200 OK’ result.

    Definition Classes
    Results
  94. val PARTIAL_CONTENT : Int

    Definition Classes
    Status
  95. val PAYMENT_REQUIRED : Int

    Definition Classes
    Status
  96. val PRAGMA : String

    Definition Classes
    HeaderNames
  97. val PRECONDITION_FAILED : Int

    Definition Classes
    Status
  98. val PROXY_AUTHENTICATE : String

    Definition Classes
    HeaderNames
  99. val PROXY_AUTHENTICATION_REQUIRED : Int

    Definition Classes
    Status
  100. val PROXY_AUTHORIZATION : String

    Definition Classes
    HeaderNames
  101. val PartialContent : Status

    Generates a ‘206 PARTIAL_CONTENT’ result.

    Generates a ‘206 PARTIAL_CONTENT’ result.

    Definition Classes
    Results
  102. val PreconditionFailed : Status

    Generates a ‘412 PRECONDITION_FAILED’ result.

    Generates a ‘412 PRECONDITION_FAILED’ result.

    Definition Classes
    Results
  103. val RANGE : String

    Definition Classes
    HeaderNames
  104. val REFERER : String

    Definition Classes
    HeaderNames
  105. val REQUESTED_RANGE_NOT_SATISFIABLE : Int

    Definition Classes
    Status
  106. val REQUEST_ENTITY_TOO_LARGE : Int

    Definition Classes
    Status
  107. val REQUEST_TIMEOUT : Int

    Definition Classes
    Status
  108. val REQUEST_URI_TOO_LONG : Int

    Definition Classes
    Status
  109. val RESET_CONTENT : Int

    Definition Classes
    Status
  110. val RETRY_AFTER : String

    Definition Classes
    HeaderNames
  111. def Redirect (call: Call): SimpleResult[EmptyContent]

    Generates a redirect simple result.

    Generates a redirect simple result.

    call

    Call defining the URL to redirect to, which typically comes from the reverse router

    Definition Classes
    Results
  112. def Redirect (url: String, queryString: Map[String, Seq[String]] = Map.empty, status: Int = SEE_OTHER): SimpleResult[EmptyContent]

    Generates a redirect simple result.

    Generates a redirect simple result.

    url

    the URL to redirect to

    queryString

    queryString parameters to add to the queryString

    status

    HTTP status

    Definition Classes
    Results
  113. def Redirect (url: String, status: Int): SimpleResult[EmptyContent]

    Generates a redirect simple result.

    Generates a redirect simple result.

    url

    the URL to redirect to

    status

    HTTP status

    Definition Classes
    Results
  114. val RequestTimeout : Status

    Generates a ‘408 REQUEST_TIMEOUT’ result.

    Generates a ‘408 REQUEST_TIMEOUT’ result.

    Definition Classes
    Results
  115. val ResetContent : SimpleResult[EmptyContent]

    Generates a ‘205 RESET_CONTENT’ result.

    Generates a ‘205 RESET_CONTENT’ result.

    Definition Classes
    Results
  116. val SEE_OTHER : Int

    Definition Classes
    Status
  117. val SERVER : String

    Definition Classes
    HeaderNames
  118. val SERVICE_UNAVAILABLE : Int

    Definition Classes
    Status
  119. val SET_COOKIE : String

    Definition Classes
    HeaderNames
  120. val SET_COOKIE2 : String

    Definition Classes
    HeaderNames
  121. val SWITCHING_PROTOCOLS : Int

    Definition Classes
    Status
  122. def SeeOther (url: String): SimpleResult[EmptyContent]

    Generates a ‘303 SEE_OTHER’ simple result.

    Generates a ‘303 SEE_OTHER’ simple result.

    url

    the URL to redirect to

    Definition Classes
    Results
  123. val ServiceUnavailable : Status

    Generates a ‘503 SERVICE_UNAVAILABLE’ result.

    Generates a ‘503 SERVICE_UNAVAILABLE’ result.

    Definition Classes
    Results
  124. def Status (code: Int): Status

    Generates a simple result.

    Generates a simple result.

    code

    the status code

    Definition Classes
    Results
  125. val TE : String

    Definition Classes
    HeaderNames
  126. val TEMPORARY_REDIRECT : Int

    Definition Classes
    Status
  127. def TEXT (implicit codec: Codec): String

    Content-Type of text according the implicit codec value.

    Content-Type of text according the implicit codec value.

    Definition Classes
    ContentTypes
  128. val TODO : Action[AnyContent]

    Provides an empty Action implementation: the result is a standard ‘Not implemented yet’ result page.

    Provides an empty Action implementation: the result is a standard ‘Not implemented yet’ result page.

    For example:

    def index(name:String) = TODO
    
    Definition Classes
    Controller
  129. val TOO_MANY_REQUEST : Int

    Definition Classes
    Status
  130. val TRAILER : String

    Definition Classes
    HeaderNames
  131. val TRANSFER_ENCODING : String

    Definition Classes
    HeaderNames
  132. def TemporaryRedirect (url: String): SimpleResult[EmptyContent]

    Generates a ‘307 TEMPORARY_REDIRECT’ simple result.

    Generates a ‘307 TEMPORARY_REDIRECT’ simple result.

    url

    the URL to redirect to

    Definition Classes
    Results
  133. val TooManyRequest : Status

    Generates a ‘429 TOO_MANY_REQUEST’ result.

    Generates a ‘429 TOO_MANY_REQUEST’ result.

    Definition Classes
    Results
  134. val UNAUTHORIZED : Int

    Definition Classes
    Status
  135. val UNSUPPORTED_MEDIA_TYPE : Int

    Definition Classes
    Status
  136. val UPGRADE : String

    Definition Classes
    HeaderNames
  137. val USER_AGENT : String

    Definition Classes
    HeaderNames
  138. val USE_PROXY : Int

    Definition Classes
    Status
  139. val Unauthorized : Status

    Generates a ‘401 UNAUTHORIZED’ result.

    Generates a ‘401 UNAUTHORIZED’ result.

    Definition Classes
    Results
  140. val UnsupportedMediaType : Status

    Generates a ‘415 UNSUPPORTED_MEDIA_TYPE’ result.

    Generates a ‘415 UNSUPPORTED_MEDIA_TYPE’ result.

    Definition Classes
    Results
  141. val UriTooLong : Status

    Generates a ‘414 REQUEST_URI_TOO_LONG’ result.

    Generates a ‘414 REQUEST_URI_TOO_LONG’ result.

    Definition Classes
    Results
  142. val VARY : String

    Definition Classes
    HeaderNames
  143. val VIA : String

    Definition Classes
    HeaderNames
  144. val WARNING : String

    Definition Classes
    HeaderNames
  145. val WWW_AUTHENTICATE : String

    Definition Classes
    HeaderNames
  146. def XML (implicit codec: Codec): String

    Content-Type of xml according the implicit codec value.

    Content-Type of xml according the implicit codec value.

    Definition Classes
    ContentTypes
  147. val X_FORWARDED_FOR : String

    Definition Classes
    HeaderNames
  148. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  149. def at (rootPath: String, file: String): Action[AnyContent]

    Generates an Action that serves a static resource from an external folder

    Generates an Action that serves a static resource from an external folder

    file

    the file part extracted from the URL

  150. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  151. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  152. def equals (arg0: Any): Boolean

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

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  154. implicit def flash (implicit request: RequestHeader): Flash

    Retrieve the flash scope implicitly from the request.

    Retrieve the flash scope implicitly from the request.

    For example:

    def index(name:String) = Action { implicit request =>
      val message = flash("message")
      Ok("Got " + message)
    }
    
    Attributes
    implicit
    Definition Classes
    Controller
  155. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef → Any
  156. def hashCode (): Int

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

    Attributes
    final
    Definition Classes
    Any
  158. implicit def lang (implicit request: RequestHeader): Lang

    Attributes
    implicit
    Definition Classes
    Controller
  159. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  160. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  161. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  162. object parse extends AnyRef

    Default body parsers.

  163. implicit def session (implicit request: RequestHeader): Session

    Retrieves the session implicitly from the request.

    Retrieves the session implicitly from the request.

    For example:

    def index(name:String) = Action { implicit request =>
      val username = session("username")
      Ok("Hello " + username)
    }
    
    Attributes
    implicit
    Definition Classes
    Controller
  164. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  165. def toString (): String

    Definition Classes
    AnyRef → Any
  166. def wait (): Unit

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

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from Controller

Inherited from RequestExtractors

Inherited from AcceptExtractors

Inherited from ContentTypes

Inherited from HeaderNames

Inherited from Status

Inherited from BodyParsers

Inherited from Results

Inherited from AnyRef

Inherited from Any