Class InstallationSettings

java.lang.Object
de.hsh.graja.util.ConfigBase
de.hsh.graja.common.InstallationSettings

public class InstallationSettings extends ConfigBase

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.

  • Field Details

    • CONF_KEY_JDK_HOME

      public static final ConfigBase.KD<String> CONF_KEY_JDK_HOME
      Key of the installation directory of the JDK. Mandatory.
    • CONF_KEY_SPACE_LIMITED_STUDENT_WORKSPACE

      public static final ConfigBase.KD<String> CONF_KEY_SPACE_LIMITED_STUDENT_WORKSPACE
      Key of the setting, whether space limited student workspaces are enabled. Optional.
    • CONF_KEY_BASH_CMD

      public static final ConfigBase.KD<String> CONF_KEY_BASH_CMD
      Key of the path to bash executable. Mandatory, if space limited student workspaces are enabled.
    • CONF_KEY_JAVA_IO_TMPDIR

      public static final ConfigBase.KD<String> CONF_KEY_JAVA_IO_TMPDIR
      Key to the path to temporary directory. Mandatory.
    • CONF_KEY_JAVAFX_HOME

      public static final ConfigBase.KD<String> CONF_KEY_JAVAFX_HOME
      Key to the path to temporary directory. Optional. If missing, no JavaFX assignments can be graded.
  • Method Details

    • isBooleanPropertyValue

      public static boolean isBooleanPropertyValue(String value)
      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

      public static boolean isBooleanTruePropertyValue(String value)
      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

      public static boolean isBooleanFalsePropertyValue(String value)
      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

      public static String allowedBooleanPropertyValues()
      Returns:
      a comma-separated string with the values that are classified true by method isBooleanPropertyValue(String).
    • isStringUnsupportedValue

      public static boolean isStringUnsupportedValue(String value)
      Parameters:
      value - any string value
      Returns:
      true, if value is not null and its trimmed lower case is "___unsupported___".
    • getGrajaHome

      public static String getGrajaHome()
      Readonly property.
      Returns:
      the installation directory of GrajaCore.jar. Mandatory.
    • getBashCmd

      public static String 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

      public static String getTmpDir()
      Readonly property, since it is needed on startup when evaluating policy files.
      Returns:
      the path to temporary directory. Mandatory.
    • createTmpDir

      public static Path createTmpDir(String prefix, FileAttribute<?>... attrs) throws IOException
      Throws:
      IOException
    • getJdkHome

      public static String getJdkHome()
      Readonly property
      Returns:
      the installation directory of the JDK. Mandatory.
    • getJavaFxHome

      public static String getJavaFxHome()
      Readonly property
      Returns:
      the installation directory of JavaFX. Optional. If the returned value is null, then no JavaFX assignments can be graded.
    • getJavaFxLibDir

      public static String 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

      public static String 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

      public static Properties 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.