Class FileConfigProvider
- java.lang.Object
-
- org.apache.kafka.common.config.provider.FileConfigProvider
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ConfigProvider
,Configurable
public class FileConfigProvider extends Object implements ConfigProvider
An implementation ofConfigProvider
that represents a Properties file. All property keys and values are stored as cleartext.
-
-
Constructor Summary
Constructors Constructor Description FileConfigProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
configure(Map<String,?> configs)
Configure this class with the given key-value pairsConfigData
get(String path)
Retrieves the data at the given Properties file.ConfigData
get(String path, Set<String> keys)
Retrieves the data with the given keys at the given Properties file.protected Reader
reader(String path)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.kafka.common.config.provider.ConfigProvider
subscribe, unsubscribe, unsubscribeAll
-
-
-
-
Method Detail
-
configure
public void configure(Map<String,?> configs)
Description copied from interface:Configurable
Configure this class with the given key-value pairs- Specified by:
configure
in interfaceConfigurable
-
get
public ConfigData get(String path)
Retrieves the data at the given Properties file.- Specified by:
get
in interfaceConfigProvider
- Parameters:
path
- the file where the data resides- Returns:
- the configuration data
-
get
public ConfigData get(String path, Set<String> keys)
Retrieves the data with the given keys at the given Properties file.- Specified by:
get
in interfaceConfigProvider
- Parameters:
path
- the file where the data resideskeys
- the keys whose values will be retrieved- Returns:
- the configuration data
-
reader
protected Reader reader(String path) throws IOException
- Throws:
IOException
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
-