play
Class Application

java.lang.Object
  extended by play.Application

public class Application
extends java.lang.Object

A Play application.

Application creation is handled by the framework engine.


Constructor Summary
Application(play.api.Application application)
          Creates an application from a Scala Application value.
 
Method Summary
 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()
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Application

public Application(play.api.Application application)
Creates an application from a Scala Application value.

Method Detail

getWrappedApplication

public play.api.Application getWrappedApplication()

path

public java.io.File path()
Retrieves the application path.

Returns:
the application path

configuration

public Configuration configuration()
Retrieves the application configuration/

Returns:
the application path

classloader

public java.lang.ClassLoader classloader()
Retrieves the application classloader.

Returns:
the application classloader

getFile

public java.io.File getFile(java.lang.String relativePath)
Retrieves a file relative to the application root path.

Parameters:
relativePath - relative path of the file to fetch
Returns:
a file instance - it is not guaranteed that the file exists

resource

public java.net.URL resource(java.lang.String relativePath)
Retrieves a resource from the classpath.

Parameters:
relativePath - relative path of the resource to fetch
Returns:
URL to the resource (may be null)

resourceAsStream

public java.io.InputStream resourceAsStream(java.lang.String relativePath)
Retrieves a resource stream from the classpath.

Parameters:
relativePath - relative path of the resource to fetch
Returns:
InputStream to the resource (may be null)

plugin

public <T> T plugin(java.lang.Class<T> pluginClass)
Retrieve the plugin instance for the class.


isDev

public boolean isDev()
Returns `true` if the application is `DEV` mode.


isProd

public boolean isProd()
Returns `true` if the application is `PROD` mode.


isTest

public boolean isTest()
Returns `true` if the application is `TEST` mode.