org.opennms.core.utils
Class PropertiesCache

java.lang.Object
  extended by org.opennms.core.utils.PropertiesCache

public class PropertiesCache
extends Object

Caches properties files in order to improve performance.

Version:
$Id: $
Author:
Mathew Brozowski

Constructor Summary
PropertiesCache()
           
 
Method Summary
 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, Properties properties)
          saveProperties
 void setProperty(File propFile, String key, String value)
          setProperty
 void updateProperties(File propFile, Map<String,String> props)
          updateProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesCache

public PropertiesCache()
Method Detail

clear

public void clear()

clear


getProperties

public Properties getProperties(File propFile)
                         throws IOException
Get the current properties object from the cache loading it in memory

Parameters:
propFile - a File object.
Returns:
a Properties object.
Throws:
IOException - if any.

findProperties

public Properties findProperties(File propFile)
                          throws IOException

findProperties

Parameters:
propFile - a File object.
Returns:
a Properties object.
Throws:
IOException - if any.

saveProperties

public void saveProperties(File propFile,
                           Properties properties)
                    throws IOException

saveProperties

Parameters:
propFile - a File object.
properties - a Properties object.
Throws:
IOException - if any.

updateProperties

public void updateProperties(File propFile,
                             Map<String,String> props)
                      throws IOException

updateProperties

Parameters:
propFile - a File object.
props - a Map object.
Throws:
IOException - if any.

setProperty

public void setProperty(File propFile,
                        String key,
                        String value)
                 throws IOException

setProperty

Parameters:
propFile - a File object.
key - a String object.
value - a String object.
Throws:
IOException - if any.

getProperty

public String getProperty(File propFile,
                          String key)
                   throws IOException

getProperty

Parameters:
propFile - a File object.
key - a String object.
Returns:
a String object.
Throws:
IOException - if any.


Copyright © 2011. All Rights Reserved.