public class PropertiesCache extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
PropertiesCache.PropertiesHolder |
| Modifier and Type | Field and Description |
|---|---|
static String |
CACHE_TIMEOUT |
static String |
CHECK_LAST_MODIFY_STRING |
static int |
DEFAULT_CACHE_TIMEOUT |
protected com.google.common.cache.Cache<String,PropertiesCache.PropertiesHolder> |
m_cache |
| Modifier | Constructor and Description |
|---|---|
|
PropertiesCache() |
protected |
PropertiesCache(com.google.common.cache.CacheBuilder<Object,Object> cacheBuilder) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
clear
|
Properties |
findProperties(File propFile)
findProperties
|
Properties |
getProperties(File propFile)
Get the current properties object from the cache loading it in memory
|
String |
getProperty(File propFile,
String key)
getProperty
|
void |
saveProperties(File propFile,
Map<String,String> attributeMappings) |
void |
saveProperties(File propFile,
Properties properties)
saveProperties
|
void |
setProperty(File propFile,
String key,
String value)
setProperty
|
void |
updateProperties(File propFile,
Map<String,String> props)
updateProperties
|
public static final String CHECK_LAST_MODIFY_STRING
public static final String CACHE_TIMEOUT
public static final int DEFAULT_CACHE_TIMEOUT
protected final com.google.common.cache.Cache<String,PropertiesCache.PropertiesHolder> m_cache
public void clear()
clear
public Properties getProperties(File propFile) throws IOException
propFile - a File object.Properties object.IOException - if any.public Properties findProperties(File propFile) throws IOException
findProperties
propFile - a File object.Properties object.IOException - if any.public void saveProperties(File propFile, Properties properties) throws IOException
saveProperties
propFile - a File object.properties - a Properties object.IOException - if any.public void saveProperties(File propFile, Map<String,String> attributeMappings) throws IOException
IOExceptionpublic void updateProperties(File propFile, Map<String,String> props) throws IOException
updateProperties
propFile - a File object.props - a Map object.IOException - if any.public void setProperty(File propFile, String key, String value) throws IOException
setProperty
propFile - a File object.key - a String object.value - a String object.IOException - if any.public String getProperty(File propFile, String key) throws IOException
getProperty
propFile - a File object.key - a String object.String object.IOException - if any.Copyright © 2022. All rights reserved.