Returns the current application.
Returns the current application classloader.
Returns the current application configuration.
Implicitly import the current running application in the context.
Implicitly import the current running application in the context.
Note that by relying on this, your code will only work properly in the context of a running application.
Retrieves a file relative to the current application root path.
Retrieves a file relative to the current application root path.
For example, to retrieve a configuration file:
val myConf = application.getExistingFile("conf/myConf.yml")
relative path of the file to fetch
an existing file
Retrieves a file relative to the current application root path.
Retrieves a file relative to the current application root path.
For example, to retrieve a configuration file:
val myConf = application.getFile("conf/myConf.yml")
the relative path of the file to fetch
a file instance; it is not guaranteed that the file exists
Returns the current application global settings.
Returns true
if the current application is DEV
mode.
Returns true
if the current application is PROD
mode.
Returns true
if the current application is TEST
mode.
Returns the name of the cookie that can be used to permanently set the user's language.
Optionally returns the current running application.
Returns the current application mode.
Scans the current application classloader to retrieve a resource.
Scans the current application classloader to retrieve a resource.
For example, to retrieve a configuration file:
val maybeConf = application.resource("conf/logger.xml")
absolute name of the resource (from the classpath root)
the resource URL, if found
Scans the current application classloader to retrieve a resources contents as a stream.
Scans the current application classloader to retrieve a resources contents as a stream.
For example, to retrieve a configuration file:
val maybeConf = application.resourceAsStream("conf/logger.xml")
Absolute name of the resource (from the classpath root).
Maybe a stream if found.
Returns the current application router.
Starts this application.
Stops the current application.
Returns the currently running application, or null
if not defined.
High-level API to access Play global features.
Note that this API depends on a running application. You can import the currently running application in a scope using:
import play.api.Play.current