@Singleton
public class Environment
extends java.lang.Object
Constructor and Description |
---|
Environment(play.api.Environment environment) |
Modifier and Type | Method and Description |
---|---|
java.lang.ClassLoader |
classLoader()
The classloader that all application classes and resources can be loaded from.
|
java.io.File |
getFile(java.lang.String relativePath)
Retrieves a file relative to the application root path.
|
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.
|
Mode |
mode()
The mode of the application.
|
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.
|
java.io.File |
rootPath()
The root path that the application is deployed at.
|
play.api.Environment |
underlying() |
public java.io.File rootPath()
public java.lang.ClassLoader classLoader()
public Mode mode()
public boolean isDev()
public boolean isProd()
public boolean isTest()
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 play.api.Environment underlying()