edu.jhu.tmaj.util.config.data
Class PropertiesReaderUtil

java.lang.Object
  extended by edu.jhu.tmaj.util.config.data.PropertiesReaderUtil

public final class PropertiesReaderUtil
extends java.lang.Object


Constructor Summary
PropertiesReaderUtil()
           
 
Method Summary
static java.util.Properties getExternalPropertiesFile(java.io.File propertiesFileName)
           
static java.util.Properties getFormattedProperties(java.util.Properties properties)
          Returns a Properties file where the keys are all in a standard format.
static java.util.Properties getInternalPropertiesFile(java.lang.String propertiesFileName)
           
static java.util.Properties readExternalPropertiesFile(java.io.File propertiesFileName)
          Gets a properties file located outside the classes directory.
static java.util.Properties readInternalPropertiesFile(java.lang.String propertiesFileName)
          Get a properties values located in the directory where the class files are.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesReaderUtil

public PropertiesReaderUtil()
Method Detail

readInternalPropertiesFile

public static java.util.Properties readInternalPropertiesFile(java.lang.String propertiesFileName)
                                                       throws java.io.IOException
Get a properties values located in the directory where the class files are. This includes inside the jar file if this class is executing as a jar. Example: Properties props = getInternalPropertiesFile("edu/jhu/tmaj/somepackage/test.properties") Null is returned if the properties file does not exist

Throws:
java.io.IOException

getInternalPropertiesFile

public static java.util.Properties getInternalPropertiesFile(java.lang.String propertiesFileName)

readExternalPropertiesFile

public static java.util.Properties readExternalPropertiesFile(java.io.File propertiesFileName)
                                                       throws java.io.IOException
Gets a properties file located outside the classes directory. For example, it might be in C:\temp\test. Return null if the external file does not exist

Throws:
java.io.IOException

getExternalPropertiesFile

public static java.util.Properties getExternalPropertiesFile(java.io.File propertiesFileName)

getFormattedProperties

public static java.util.Properties getFormattedProperties(java.util.Properties properties)
Returns a Properties file where the keys are all in a standard format.