@Singleton
public class Application
extends java.lang.Object
Application creation is handled by the framework engine.
Constructor and Description |
---|
Application(play.api.Application application,
Injector injector)
Creates an application from a Scala Application value.
|
Modifier and Type | Method and Description |
---|---|
java.lang.ClassLoader |
classloader()
Retrieves the application classloader.
|
Configuration |
configuration()
Retrieves the application configuration/
|
java.io.File |
getFile(java.lang.String relativePath)
Retrieves a file relative to the application root path.
|
play.api.Application |
getWrappedApplication() |
Injector |
injector()
Get the injector for this application.
|
boolean |
isDev()
Returns `true` if the application is `DEV` mode.
|
boolean |
isProd()
Returns `true` if the application is `PROD` mode.
|
boolean |
isTest()
Returns `true` if the application is `TEST` mode.
|
java.io.File |
path()
Retrieves the application path.
|
<T> T |
plugin(java.lang.Class<T> pluginClass)
Retrieve the plugin instance for the class.
|
java.net.URL |
resource(java.lang.String relativePath)
Retrieves a resource from the classpath.
|
java.io.InputStream |
resourceAsStream(java.lang.String relativePath)
Retrieves a resource stream from the classpath.
|
@Inject public Application(play.api.Application application, Injector injector)
public play.api.Application getWrappedApplication()
public java.io.File path()
public Configuration configuration()
public java.lang.ClassLoader classloader()
public java.io.File getFile(java.lang.String relativePath)
relativePath
- relative path of the file to fetchpublic java.net.URL resource(java.lang.String relativePath)
relativePath
- relative path of the resource to fetchpublic java.io.InputStream resourceAsStream(java.lang.String relativePath)
relativePath
- relative path of the resource to fetchpublic <T> T plugin(java.lang.Class<T> pluginClass)
public boolean isDev()
public boolean isProd()
public boolean isTest()
public Injector injector()