Class FileMetaConfiguration


  • public final class FileMetaConfiguration
    extends Object
    A FileMetaConfiguration is a grouping of all file configurations related to the client. FileMetaConfiguration consist of a list of entries which each entry is a pair of path prefix to those that are to be used for paths starting with the given prefix. The list of entries are searched in the order until a match is found.
    • Field Detail

      • DEFAULT_CONFIGURATION

        public static FileMetaConfiguration DEFAULT_CONFIGURATION
        An empty configuration that only has default configuration.
    • Method Detail

      • entry

        public static FileMetaConfiguration.Entry entry​(Path prefix,
                                                        FileConfiguration configuration)
        Creates a new entry
        Parameters:
        prefix - the path prefix
        configuration - the configuration to use for paths that start with the given prefix
        Returns:
        a new entry
      • configuration

        public static FileMetaConfiguration configuration​(FileMetaConfiguration.Entry... entries)
        Creates a new meta-configuration consisting of the given entries. The resulting meta-configuration will also acquire any default configuration from the execution environment.
        Parameters:
        entries - the entries
        Returns:
        the configuration
      • configuration

        public static FileMetaConfiguration configuration​(List<FileMetaConfiguration.Entry> entries)
        Creates a new meta-configuration consisting of the given entries. The resulting configuration will also acquire any default configuration from the execution environment.
        Parameters:
        entries - the entries
        Returns:
        the configuration
      • exactConfiguration

        public static FileMetaConfiguration exactConfiguration​(FileMetaConfiguration.Entry... entries)
        Creates a new configuration consisting of onlythe given entries; no default configuration is acquired.
        Parameters:
        entries - the entries
        Returns:
        the configuration
      • exactConfiguration

        public static FileMetaConfiguration exactConfiguration​(List<FileMetaConfiguration.Entry> entries)
        Creates a new configuration consisting of onlythe given entries; no default configuration is acquired.
        Parameters:
        entries - the entries
        Returns:
        the configuration
      • resetDefaultConfiguration

        public FileMetaConfiguration resetDefaultConfiguration()
        Gets a new meta-configuration with the default configuration replaced with those from the current environment.

        This is equivalent to calling FileMetaConfiguration.exactConfiguration(this.getEntries()).

        Returns:
        a new configuration inheriting default configuration from the current environment
      • removeDefaultConfiguration

        public FileMetaConfiguration removeDefaultConfiguration()
        Gets a new meta-configuration with all default configuration removed. This strips all configuration inherited from the execution environment from the resulting configuration.

        This is equivalent to calling FileMetaConfiguration.exactConfiguration(this.getEntries()).

        Returns:
        a new configuration without default configuration
      • findEntry

        public FileMetaConfiguration.Entry findEntry​(Path path)
        Returns the first entry whose prefix is a prefix of the given path
        Parameters:
        path - the path
        Returns:
        the matching entry or null if no matches found