@Singleton
public class Environment
extends java.lang.Object
Constructor and Description |
---|
Environment(play.api.Environment environment) |
Environment(java.io.File rootPath) |
Environment(java.io.File rootPath,
java.lang.ClassLoader classLoader,
Mode mode) |
Environment(java.io.File rootPath,
Mode mode) |
Environment(Mode mode) |
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.
|
static Environment |
simple()
A simple environment.
|
play.api.Environment |
underlying()
The underlying Scala API Environment object that this Environment
wraps.
|
@Inject public Environment(play.api.Environment environment)
public Environment(java.io.File rootPath, java.lang.ClassLoader classLoader, Mode mode)
public Environment(java.io.File rootPath, Mode mode)
public Environment(java.io.File rootPath)
public Environment(Mode mode)
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 static Environment simple()
public play.api.Environment underlying()