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 instance)
        Builds a new file based Environment using the given file as the instance directory.
        Parameters:
        instance - IG instance directory
      • DefaultEnvironment

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

      • getInstanceDirectory

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

        public File getTempDirectory()
        Description copied from interface: Environment
        Returns the temporary directory of IG (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.