org.opennms.core.utils
Class PropertiesCache

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

public class PropertiesCache
extends java.lang.Object

Caches properties files in order to improve performance.

Author:
brozow

Constructor Summary
PropertiesCache()
           
 
Method Summary
 void clear()
           
 java.util.Properties findProperties(java.io.File propFile)
           
 java.util.Properties getProperties(java.io.File propFile)
          Get the current properties object from the cache loading it in memory
 java.lang.String getProperty(java.io.File propFile, java.lang.String key)
           
 void saveProperties(java.io.File propFile, java.util.Properties properties)
           
 void setProperty(java.io.File propFile, java.lang.String key, java.lang.String value)
           
 void updateProperties(java.io.File propFile, java.util.Map<java.lang.String,java.lang.String> props)
           
 
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()

getProperties

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

Parameters:
propFile -
Returns:
Throws:
java.io.IOException

findProperties

public java.util.Properties findProperties(java.io.File propFile)
                                    throws java.io.IOException
Throws:
java.io.IOException

saveProperties

public void saveProperties(java.io.File propFile,
                           java.util.Properties properties)
                    throws java.io.IOException
Throws:
java.io.IOException

updateProperties

public void updateProperties(java.io.File propFile,
                             java.util.Map<java.lang.String,java.lang.String> props)
                      throws java.io.IOException
Throws:
java.io.IOException

setProperty

public void setProperty(java.io.File propFile,
                        java.lang.String key,
                        java.lang.String value)
                 throws java.io.IOException
Throws:
java.io.IOException

getProperty

public java.lang.String getProperty(java.io.File propFile,
                                    java.lang.String key)
                             throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2007. All Rights Reserved.