Package org.forgerock.openig.config.env
Class DefaultEnvironment
- java.lang.Object
-
- org.forgerock.openig.config.env.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 Summary
Constructors Constructor Description DefaultEnvironment(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description File
getConfigDirectory()
Returns the directory that contains the configuration files.File
getInstanceDirectory()
Returns the instance directory of the IG file system.File
getScriptDirectory(String type)
Returns the directory that contains the files of the given type.File
getTempDirectory()
Returns the temporary directory of IG (where we have read+write permissions).-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.forgerock.openig.config.Environment
getBaseDirectory
-
-
-
-
Constructor Detail
-
DefaultEnvironment
public DefaultEnvironment(File instance)
Builds a new file basedEnvironment
using the given file as the instance directory.- Parameters:
instance
- IG instance directory
-
DefaultEnvironment
public DefaultEnvironment(File instance, File temp)
Builds a new file basedEnvironment
using the given file as the instance directory.- Parameters:
instance
- IG instance directorytemp
- 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 interfaceEnvironment
- 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 interfaceEnvironment
- 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 interfaceEnvironment
- 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 interfaceEnvironment
- Returns:
- the configuration directory.
-
-