Class Configuration

java.lang.Object
ece.ing3.java.projet.configuration.Configuration

public class Configuration extends Object
Configuration helper.

Offers a convenient way to get and set configuration parameters.

Author:
Virgile, Nicolas, Louis-Félix
  • Constructor Details

    • Configuration

      public Configuration()
  • Method Details

    • init

      public static void init()
      Loads the configuration.
    • get

      public static Preferences get()
      Returns the underlying Preferences instance.
      Returns:
      Preferences instance
    • save

      public static void save() throws BackingStoreException
      Saves the configuration.
      Throws:
      BackingStoreException - Error while saving.
    • getString

      public static String getString(String key)
      Get a configuration String value by key.
      Parameters:
      key - Configuration key
      Returns:
      Value
    • getString

      public static String getString(String key, String defaultValue)
      Get a configuration String value by key.
      Parameters:
      key - Configuration key
      defaultValue - Default value
      Returns:
      Value
    • set

      public static void set(String key, String value)
      Sets a configuration value.
      Parameters:
      key - Configuration key
      value - Value
    • getUserDataPath

      public static Path getUserDataPath()
      Gets the application's data storage path for the current user.
      Returns:
      Application data storage path or null on error