public class PropertyUtils extends Object
Constructor and Description |
---|
PropertyUtils() |
Modifier and Type | Method and Description |
---|---|
static int |
getInt(String property_value) |
static int |
getInt(String property_value,
int default_value)
INTERNAL: Returns the property value as an int.
|
static String |
getProperty(Map<String,String> properties,
String name)
INTERNAL: Helper method used to get better error messages with
less typing.
|
static String |
getProperty(Map<String,String> properties,
String name,
boolean required)
INTERNAL: Helper method used to get better error messages with
less typing.
|
static boolean |
isTrue(String property_value,
boolean default_value) |
static Properties |
loadProperties(File propfile)
INTERNAL; Reads properties from a file.
|
static Properties |
loadProperties(InputStream istream) |
static Properties |
loadPropertiesFromClassPath(String resource) |
static Map<String,String> |
toMap(Properties properties) |
public static String getProperty(Map<String,String> properties, String name)
public static String getProperty(Map<String,String> properties, String name, boolean required)
public static boolean isTrue(String property_value, boolean default_value)
public static int getInt(String property_value, int default_value)
public static int getInt(String property_value) throws NumberFormatException
NumberFormatException
public static Properties loadProperties(File propfile) throws IOException
IOException
public static Properties loadPropertiesFromClassPath(String resource) throws IOException
IOException
public static Properties loadProperties(InputStream istream) throws IOException
IOException
public static Map<String,String> toMap(Properties properties)