Package de.hsh.graja.common
Class InstallationSettings
java.lang.Object
de.hsh.graja.util.ConfigBase
de.hsh.graja.common.InstallationSettings
This class defines configuration options that Graja depends on. Configuration is loaded automatically on startup of the GrajaStarter and the client applications. The Graja source code will not access system properties directly, but through this class' get methods.
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hsh.graja.util.ConfigBase
ConfigBase.KD<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ConfigBase.KD<String>
Key of the path to bash executable.static final ConfigBase.KD<String>
Key to the path to temporary directory.static final ConfigBase.KD<String>
Key to the path to temporary directory.static final ConfigBase.KD<String>
Key of the installation directory of the JDK.static final ConfigBase.KD<String>
Key of the setting, whether space limited student workspaces are enabled. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
static Path
createTmpDir
(String prefix, FileAttribute<?>... attrs) Creates a directory belowgetTmpDir()
usingFiles.createTempDirectory(String, FileAttribute...)
static String
Readonly property.static String
Readonly property.static String
Readonly propertystatic String
Readonly property, Convenience-Methodstatic String
Readonly property, Convenience-Methodstatic String
Readonly propertystatic Properties
Readonly data.static String
Readonly property, since it is needed on startup when evaluating policy files.static boolean
static boolean
isBooleanPropertyValue
(String value) static boolean
isBooleanTruePropertyValue
(String value) static boolean
isStringUnsupportedValue
(String value) static boolean
Readonly property.Methods inherited from class de.hsh.graja.util.ConfigBase
getDump, getProp, getUnmodifiableMapStringStringView, loadAndValidate, loadAndValidate, loadAndValidate, save, setAndValidate, setProp
-
Field Details
-
CONF_KEY_JDK_HOME
Key of the installation directory of the JDK. Mandatory. -
CONF_KEY_SPACE_LIMITED_STUDENT_WORKSPACE
Key of the setting, whether space limited student workspaces are enabled. Optional. -
CONF_KEY_BASH_CMD
Key of the path to bash executable. Mandatory, if space limited student workspaces are enabled. -
CONF_KEY_JAVA_IO_TMPDIR
Key to the path to temporary directory. Mandatory. -
CONF_KEY_JAVAFX_HOME
Key to the path to temporary directory. Optional. If missing, no JavaFX assignments can be graded.
-
-
Method Details
-
isBooleanPropertyValue
- Parameters:
value
- any string value- Returns:
- true, if
value
is not null and its trimmed lower case is one of {"enabled", "on", "true", "yes", "disabled", "off", "false", "no"}}.
-
isBooleanTruePropertyValue
- Parameters:
value
- any string value- Returns:
- true, if
value
is not null and its trimmed lower case is one of {"enabled", "on", "true", "yes"}.
-
isBooleanFalsePropertyValue
- Parameters:
value
- any string value- Returns:
- true, if
value
is not null and its trimmed lower case is one of {"disabled", "off", "false", "no"}.
-
allowedBooleanPropertyValues
- Returns:
- a comma-separated string with the values that are classified true
by method
isBooleanPropertyValue(String)
.
-
isStringUnsupportedValue
- Parameters:
value
- any string value- Returns:
- true, if
value
is not null and its trimmed lower case is "___unsupported___".
-
getGrajaHome
Readonly property.- Returns:
- the installation directory of GrajaCore.jar. Mandatory.
-
getBashCmd
Readonly property.- Returns:
- the installation directory of Graja resources. Mandatory.
-
spaceLimitedStudentWorkspaceEnabled
public static boolean spaceLimitedStudentWorkspaceEnabled()Readonly property.- Returns:
- the setting, whether space limited student workspaces are enabled. Optional.
-
getTmpDir
Readonly property, since it is needed on startup when evaluating policy files.- Returns:
- the path to temporary directory. Mandatory.
-
createTmpDir
Creates a directory belowgetTmpDir()
usingFiles.createTempDirectory(String, FileAttribute...)
- Throws:
IOException
-
getJdkHome
Readonly property- Returns:
- the installation directory of the JDK. Mandatory.
-
getJavaFxHome
Readonly property- Returns:
- the installation directory of JavaFX. Optional. If the returned value is null, then no JavaFX assignments can be graded.
-
getJavaFxLibDir
Readonly property, Convenience-Method- Returns:
- path to javafx lib dir of the javafx installation. Ends with pathseperator. If null, then no JavaFX assignments can be graded.
-
getJavaFxLibClasspath
Readonly property, Convenience-Method- Returns:
- classpath-string ("/" as path.separator) containing all jars in javafx-lib-dir seperated by : or ; (dependent on os). If null, then no JavaFX assignments can be graded.
-
getModuleDependencies
Readonly data.- Returns:
- a map 'modulename' => 'classpath', where modulename in { Human, Pmd, Checkstyle, Compile, Junit }, which is the 'internalName' of the ModuleType enum, * and the classpath is a string with relative paths - rooted at the Graja home directory - to jar files, separated by spaces.
-