gov.lanl.SSLTools
Class PropertyUtilities

java.lang.Object
  |
  +--gov.lanl.SSLTools.PropertyUtilities

public class PropertyUtilities
extends java.lang.Object

Provides some useful functions on properties.

 

Field Summary
static org.apache.log4j.Logger cat
           
 
Constructor Summary
PropertyUtilities()
           
 
Method Summary
static void certifyProperties(java.lang.String inMsg, java.util.Properties props, java.lang.String[] reqKeys)
          Certifies that the required keys are in the property file, or queries for them and inserts them into the properties if missing
static void certifyProperties(java.lang.String inMsg, java.util.Properties props, java.lang.String[][] targets)
          Certifies that the required keys are in the property file, or queries for them and inserts them into the properties if missing
static boolean checkProperties(java.lang.String inMsg, java.util.Properties props, java.lang.String[] targets)
          Checks for required target properties.
static boolean checkProperties(java.lang.String inMsg, java.util.Properties props, java.lang.String[][] targets)
          Checks for required target properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cat

public static org.apache.log4j.Logger cat
Constructor Detail

PropertyUtilities

public PropertyUtilities()
Method Detail

checkProperties

public static boolean checkProperties(java.lang.String inMsg,
                                      java.util.Properties props,
                                      java.lang.String[][] targets)
Checks for required target properties.

Parameters:
inMsg - is a message prepended to the output notices
props - the Properties to check
targets - are 2D list of properties, first element in the row is the property, remaining elements in row are the acceptable values, if no value elements any value other than null is ok
Returns:
true if all the elements of targets are define in properties, else false

certifyProperties

public static void certifyProperties(java.lang.String inMsg,
                                     java.util.Properties props,
                                     java.lang.String[][] targets)
Certifies that the required keys are in the property file, or queries for them and inserts them into the properties if missing

Parameters:
inMsg - is a message prepended to the output notices
props - the Properties to check
targets - are 2D list of properties, first element in the row is the property, remaining elements in row are the acceptable values, if no value elements any value other than null is ok

checkProperties

public static boolean checkProperties(java.lang.String inMsg,
                                      java.util.Properties props,
                                      java.lang.String[] targets)
Checks for required target properties.

Parameters:
inMsg - is a message prepended to the output notices
props - the Properties to check
targets - are the list of properties to require in props
Returns:
true if properties, else false

certifyProperties

public static void certifyProperties(java.lang.String inMsg,
                                     java.util.Properties props,
                                     java.lang.String[] reqKeys)
Certifies that the required keys are in the property file, or queries for them and inserts them into the properties if missing

Parameters:
inMsg - is a message prepended to the output notices
props - the Properties to check
reqKeys - are the list of properties to require in props