public class ProfileUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
ProfileUtil.ProcessorConfigurationExtractor |
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_PROFILE |
static ProfileUtil.ProcessorConfigurationExtractor |
ENRICHER_CONFIG
Get the enricher configuration
|
static ProfileUtil.ProcessorConfigurationExtractor |
GENERATOR_CONFIG
Get the generator configuration
|
static ProfileUtil.ProcessorConfigurationExtractor |
WATCHER_CONFIG
Get the watcher configuration
|
| Modifier and Type | Method and Description |
|---|---|
static ProcessorConfig |
blendProfileWithConfiguration(ProfileUtil.ProcessorConfigurationExtractor configExtractor,
String profile,
List<File> resourceDirs,
ProcessorConfig config)
Find an enricher or generator config, possibly via a profile and merge it with a given configuration.
|
static Profile |
findProfile(String profileArg,
File... resourceDirs)
Find a profile.
|
static Profile |
findProfile(String profileArg,
List<File> resourceDirs) |
static List<Profile> |
fromYaml(InputStream is)
Load a profile from an input stream.
|
static Profile |
lookup(String name,
File directory)
Lookup profiles from a given directory and merge it with a profile of the
same name found in the classpath
|
static List<Profile> |
readAllFromClasspath(String name,
String ext)
Read all profiles found in the classpath.
|
public static final String DEFAULT_PROFILE
public static final ProfileUtil.ProcessorConfigurationExtractor GENERATOR_CONFIG
public static final ProfileUtil.ProcessorConfigurationExtractor ENRICHER_CONFIG
public static final ProfileUtil.ProcessorConfigurationExtractor WATCHER_CONFIG
public static Profile findProfile(String profileArg, List<File> resourceDirs) throws IOException
IOExceptionpublic static Profile findProfile(String profileArg, File... resourceDirs) throws IOException
findProfile(String, File[])profileArg - the profile's nameresourceDirs - directories to check for profiles.IOException - if there's a problem while performing IO operations.public static ProcessorConfig blendProfileWithConfiguration(ProfileUtil.ProcessorConfigurationExtractor configExtractor, String profile, List<File> resourceDirs, ProcessorConfig config) throws IOException
configExtractor - how to extract the config from a profile when foundprofile - the profile name (can be null, then no profile is used)resourceDirs - resource directory where to lookup the profile (in addition to a classpath lookup)config - the provided configurationIOExceptionpublic static Profile lookup(String name, File directory) throws IOException
name - name of the profile to lookupdirectory - directory to lookupIOException - if somethings fails during lookuppublic static List<Profile> readAllFromClasspath(String name, String ext) throws IOException
name - name of the profile to lookupext - to use (e.g. 'default' for checking 'profile-default.yml'. Can also be null or empty.IOException - if reading of a profile failspublic static List<Profile> fromYaml(InputStream is) throws IOException
is - inputstream to read the profile fromIOException - if deserialization failsCopyright © 2022. All rights reserved.