Package play

Class Play


  • public class Play
    extends java.lang.Object
    Main framework class
    • Field Detail

      • started

        public static boolean started
      • id

        public static java.lang.String id
      • applicationPath

        public static java.io.File applicationPath
      • tmpDir

        public static java.io.File tmpDir
      • roots

        public static java.util.List<VirtualFile> roots
        All paths to search for files
      • templatesPath

        public static java.util.List<VirtualFile> templatesPath
        All paths to search for templates files
      • routes

        public static VirtualFile routes
        Main routes file
      • modulesRoutes

        public static java.util.Map<java.lang.String,​VirtualFile> modulesRoutes
        Plugin routes files
      • configuration

        public static java.util.Properties configuration
        The app configuration (already resolved from the framework id)
      • startedAt

        public static long startedAt
        The last time than the application has started
      • langs

        public static java.util.List<java.lang.String> langs
        The list of supported locales
      • secretKey

        public static java.lang.String secretKey
        The very secret key
      • pluginCollection

        public static PluginCollection pluginCollection
        pluginCollection that holds all loaded plugins and all enabled plugins..
      • modules

        public static java.util.Map<java.lang.String,​VirtualFile> modules
        Modules
      • usePrecompiled

        public static boolean usePrecompiled
      • defaultWebEncoding

        public static final java.nio.charset.Charset defaultWebEncoding
        This is used as default encoding everywhere related to the web: request, response, WS
      • invoker

        public static Invoker invoker
    • Method Detail

      • init

        public void init​(java.lang.String id)
        Init the framework
        Parameters:
        id - The framework id to use
      • start

        public void start()
        Start the application
        Throws:
        java.lang.IllegalArgumentException - if the application is already started
      • plugin

        public static <T extends PlayPlugin> T plugin​(java.lang.Class<T> clazz)
      • getVirtualFile

        public static VirtualFile getVirtualFile​(java.lang.String path)
        Search a VirtualFile in all loaded applications and plugins
        Parameters:
        path - Relative path from the applications root
        Returns:
        The virtualFile or null
      • getFile

        public static java.io.File getFile​(java.lang.String path)
        Search a File in the current application
        Parameters:
        path - Relative path from the application root
        Returns:
        The file even if it doesn't exist
      • runningInTestMode

        public static boolean runningInTestMode()
        Returns true if application is running in test-mode. Test-mode is resolved from the framework id. Your app is running in test-mode if the framework id (Play.id) is 'test' or 'test-?.*'
        Returns:
        true if test mode
      • useDefaultMockMailSystem

        public static boolean useDefaultMockMailSystem()