Module de.carne

Class FilePreferencesFactory

  • All Implemented Interfaces:
    java.util.prefs.PreferencesFactory

    public class FilePreferencesFactory
    extends java.lang.Object
    implements java.util.prefs.PreferencesFactory
    Custom PreferencesFactory implementation for storing preferences into human readable text (*.conf) files.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.prefs.Preferences customRoot​(java.io.File file)
      Creates a Preferences object backed up by a custom configuration file.
      static java.util.prefs.Preferences customRoot​(java.nio.file.Path file)
      Creates a Preferences object backed up by a custom configuration file.
      static java.util.prefs.Preferences customRoot​(java.util.Properties data)
      Creates a Preferences object backed up by a Properties object.
      static java.nio.file.Path customRootFile​(java.lang.String name)
      Gets the file path used to store custom preferences.
      static void flush()
      Flush any file based FilePreferences instance to the backing store.
      java.util.prefs.Preferences systemRoot()  
      static java.nio.file.Path systemRootFile()
      Gets the file path used to store system preferences.
      java.util.prefs.Preferences userRoot()  
      static java.nio.file.Path userRootFile()
      Gets the file path used to store user preferences.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FilePreferencesFactory

        public FilePreferencesFactory()
    • Method Detail

      • systemRoot

        public java.util.prefs.Preferences systemRoot()
        Specified by:
        systemRoot in interface java.util.prefs.PreferencesFactory
      • userRoot

        public java.util.prefs.Preferences userRoot()
        Specified by:
        userRoot in interface java.util.prefs.PreferencesFactory
      • systemRootFile

        public static java.nio.file.Path systemRootFile()
        Gets the file path used to store system preferences.
        Returns:
        the file path used to store system preferences.
      • userRootFile

        public static java.nio.file.Path userRootFile()
        Gets the file path used to store user preferences.
        Returns:
        the file path used to store user preferences.
      • customRootFile

        public static java.nio.file.Path customRootFile​(java.lang.String name)
        Gets the file path used to store custom preferences.
        Parameters:
        name - the file name to use.
        Returns:
        the file path used to store custom preferences.
      • customRoot

        public static java.util.prefs.Preferences customRoot​(java.nio.file.Path file)
        Creates a Preferences object backed up by a custom configuration file.

        The created Preferences object can be stored if the submitted custom configuration file is writable by the VM.

        Parameters:
        file - the custom configuration file to use as a preference store.
        Returns:
        the created Preferences object.
      • customRoot

        public static java.util.prefs.Preferences customRoot​(java.io.File file)
        Creates a Preferences object backed up by a custom configuration file.

        The created Preferences object can be stored if the submitted custom configuration file is writable by the VM.

        Parameters:
        file - the custom configuration file to use as a preference store.
        Returns:
        the created Preferences object.
      • customRoot

        public static java.util.prefs.Preferences customRoot​(java.util.Properties data)
        Creates a Preferences object backed up by a Properties object.

        The created Preferences object cannot be stored.

        Parameters:
        data - the Properties object defining the preference data.
        Returns:
        the created Preferences object.
      • flush

        public static void flush()
        Flush any file based FilePreferences instance to the backing store.