|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.jpcap.util.PropertyHelper
Property helper utility methods.
Constructor Summary | |
PropertyHelper()
|
Method Summary | |
static boolean |
getBooleanProperty(java.util.Properties properties,
java.lang.Object key)
Read the specified boolean property. |
static java.awt.Color |
getColorProperty(java.util.Properties properties,
java.lang.Object key)
Convert a space delimited color tuple string to a color. |
static float |
getFloatProperty(java.util.Properties properties,
java.lang.Object key)
Read the specified float property. |
static int |
getIntProperty(java.util.Properties properties,
java.lang.Object key)
Read the specified integer property. |
static int |
getIpProperty(java.util.Properties properties,
java.lang.Object key)
Convert a dot-delimited IP address to an integer. |
static java.util.Properties |
load(java.lang.String[] paths,
java.lang.String fileName)
Load the specified properties file from one of the specified set of paths. |
static java.util.Properties |
refresh(java.lang.String name,
java.io.FileInputStream fis)
Refresh property settings from disk. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PropertyHelper()
Method Detail |
public static float getFloatProperty(java.util.Properties properties, java.lang.Object key)
Throws an exception if the property value isn't a floating-point number.
key
- the name of the property
public static int getIntProperty(java.util.Properties properties, java.lang.Object key)
Throws an exception if the property value isn't an integer.
key
- the name of the property
public static java.awt.Color getColorProperty(java.util.Properties properties, java.lang.Object key)
Converts a string value like "255 255 0" to a color constant, in this case, yellow.
key
- the name of the property
public static int getIpProperty(java.util.Properties properties, java.lang.Object key)
Converts a string value like "10.0.0.5" to an integer.
key
- the name of the property
public static boolean getBooleanProperty(java.util.Properties properties, java.lang.Object key)
Returns false if the property doesn't exist or can't be converted to a boolean.
key
- the name of the property
public static java.util.Properties refresh(java.lang.String name, java.io.FileInputStream fis) throws java.io.IOException
java.io.IOException
public static java.util.Properties load(java.lang.String[] paths, java.lang.String fileName)
paths
- an array of strings containing target paths.fileName
- the name of the property file.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |