Interface ConfigRoot


  • public interface ConfigRoot
    A configuration root is a representation of where configuration data can be stored, which is ultimately mapped to a directory on disk.

    The underlying directory may refer to a shared directory (shared by many plugins) or one that is specific to a plugin. Be mindful of simply storing data in directory() depending on the type of configuration root.

    A default configuration file is provided via both configPath() and config(), but other or additional configuration files can be stored in the directory returned by directory() (as long as it's not the shared configuration folder).

    See Also:
    A provider of configuration root
    • Method Detail

      • configPath

        Path configPath()
        Gets the pathname to the default configuration file for the plugin.

        If the configuration root is shared, then the returned pathname will refer to the path $config/$plugin_id.conf (where "$config" is the shared configuration directory). Otherwise, the returned pathname will refer to a file named "config.conf" stored in a directory specific to the plugin.

        The returned pathname may refer to a file that does not yet exist. It is up to the caller of this method to create the file if desired.

        Returns:
        A file, which may not yet exist
        See Also:
        DefaultConfig
      • directory

        Path directory()
        Gets the directory that this configuration root refers to.

        The returned pathname may not refer to a directory that exists yet.

        Returns:
        A directory