Package org.forgerock.openig.config.env
Class DefaultEnvironment
java.lang.Object
org.forgerock.openig.config.env.DefaultEnvironment
- All Implemented Interfaces:
Environment
Reify the normal environment structure with pre-configured shortcuts.
conf/**.json
scripts/groovy/**.groovy
tmp/
- Since:
- 2.2
-
Constructor Summary
ConstructorDescriptionDefaultEnvironment
(File instance) Builds a new file basedEnvironment
using the given file as the instance directory.DefaultEnvironment
(File instance, File temp) Builds a new file basedEnvironment
using the given file as the instance directory. -
Method Summary
Modifier and TypeMethodDescriptionReturns the directory that contains the configuration files.Returns the instance directory of the IG file system.getScriptDirectory
(String type) Returns the directory that contains the files of the given type.Returns the temporary directory of IG (where we have read+write permissions).
-
Constructor Details
-
DefaultEnvironment
Builds a new file basedEnvironment
using the given file as the instance directory.- Parameters:
instance
- IG instance directory
-
DefaultEnvironment
Builds a new file basedEnvironment
using the given file as the instance directory.- Parameters:
instance
- IG instance directorytemp
- IG temp directory
-
-
Method Details
-
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 interfaceEnvironment
- Returns:
- the instance directory of the IG file system.
-
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 interfaceEnvironment
- Returns:
- the working directory.
-
getScriptDirectory
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 interfaceEnvironment
- Parameters:
type
- script's type (could be groovy or js)- Returns:
- the scripting directory.
-
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 interfaceEnvironment
- Returns:
- the configuration directory.
-