Class DefaultEnvironment

  • All Implemented Interfaces:
    Environment

    public class DefaultEnvironment
    extends Object
    implements Environment
    Reify the normal environment structure with pre-configured shortcuts.
         
         conf/**.json
         scripts/groovy/**.groovy
         tmp/
         
     
    Since:
    2.2
    • Constructor Detail

      • DefaultEnvironment

        public DefaultEnvironment​(File base)
        Builds a new file based Environment using the given file as the base directory.
        Parameters:
        base - OpenIG base directory
    • Method Detail

      • getBaseDirectory

        public File getBaseDirectory()
        Description copied from interface: Environment
        Returns the base directory of the OpenIG file system. It can be used to access resources that are not part of the standard layout.
        Specified by:
        getBaseDirectory in interface Environment
        Returns:
        the base directory of the OpenIG file system.
      • getTempDirectory

        public File getTempDirectory()
        Description copied from interface: Environment
        Returns the temporary directory of OpenIG (where we have read+write permissions). It usually points to the tmp/ directory.
        Specified by:
        getTempDirectory in interface Environment
        Returns:
        the working directory.
      • getScriptDirectory

        public File getScriptDirectory​(String type)
        Description copied from interface: Environment
        Returns the directory that contains the files of the given type. It usually points to the scripts/<type>/ directory.
        Specified by:
        getScriptDirectory in interface Environment
        Parameters:
        type - script's type (could be groovy or js)
        Returns:
        the scripting directory.
      • getConfigDirectory

        public File getConfigDirectory()
        Description copied from interface: Environment
        Returns the directory that contains the configuration files. It usually points to the config/ directory.
        Specified by:
        getConfigDirectory in interface Environment
        Returns:
        the configuration directory.