public final class FileMetaConfiguration extends Object
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.Modifier and Type | Class and Description |
---|---|
static class |
FileMetaConfiguration.Entry
An entry in the meta-configuration consisting of a path prefix and those
configurations that are to be used for paths starting with the given prefix.
|
Modifier and Type | Field and Description |
---|---|
static FileMetaConfiguration |
DEFAULT_CONFIGURATION
An empty configuration that only has default configuration.
|
Modifier and Type | Method and Description |
---|---|
static FileMetaConfiguration |
configuration(FileMetaConfiguration.Entry... entries)
Creates a new meta-configuration consisting of the given entries.
|
static FileMetaConfiguration |
configuration(List<FileMetaConfiguration.Entry> entries)
Creates a new meta-configuration consisting of the given entries.
|
static FileMetaConfiguration.Entry |
entry(Path prefix,
FileConfiguration configuration)
Creates a new entry
|
static FileMetaConfiguration |
exactConfiguration(FileMetaConfiguration.Entry... entries)
Creates a new configuration consisting of onlythe given entries;
no default configuration is acquired.
|
static FileMetaConfiguration |
exactConfiguration(List<FileMetaConfiguration.Entry> entries)
Creates a new configuration consisting of onlythe given entries;
no default configuration is acquired.
|
FileMetaConfiguration.Entry |
findEntry(Path path)
Returns the first entry whose prefix is a prefix of the given path
|
FileConfiguration |
getConfiguration(Path path)
Returns the configuration to be used for the given path or
FileConfiguration.EMPTY_CONFIGURATION
if none found. |
List<FileMetaConfiguration.Entry> |
getEntries()
Returns the list of entries contained by this configuration
|
FileMetaConfiguration |
removeDefaultConfiguration()
Gets a new meta-configuration with all default configuration removed.
|
FileMetaConfiguration |
resetDefaultConfiguration()
Gets a new meta-configuration with the default configuration replaced
with those from the current environment.
|
public static FileMetaConfiguration DEFAULT_CONFIGURATION
public static FileMetaConfiguration.Entry entry(Path prefix, FileConfiguration configuration)
prefix
- the path prefixconfiguration
- the configuration to use for paths that start with the given prefixpublic static FileMetaConfiguration configuration(FileMetaConfiguration.Entry... entries)
entries
- the entriespublic static FileMetaConfiguration configuration(List<FileMetaConfiguration.Entry> entries)
entries
- the entriespublic static FileMetaConfiguration exactConfiguration(FileMetaConfiguration.Entry... entries)
entries
- the entriespublic static FileMetaConfiguration exactConfiguration(List<FileMetaConfiguration.Entry> entries)
entries
- the entriespublic List<FileMetaConfiguration.Entry> getEntries()
public FileMetaConfiguration resetDefaultConfiguration()
This is equivalent to calling FileMetaConfiguration.exactConfiguration(this.getEntries())
.
public FileMetaConfiguration removeDefaultConfiguration()
This is equivalent to calling FileMetaConfiguration.exactConfiguration(this.getEntries())
.
public FileConfiguration getConfiguration(Path path)
FileConfiguration.EMPTY_CONFIGURATION
if none found.path
- the pathpublic FileMetaConfiguration.Entry findEntry(Path path)
path
- the pathCopyright © 2020 Actian Corporation. All rights reserved.