com.googlecode.icegem.utils
Class PropertiesHelper

java.lang.Object
  extended by com.googlecode.icegem.utils.PropertiesHelper

public class PropertiesHelper
extends Object

Loads the Properties from property file and allows to retrieve properties in more advanced way.


Constructor Summary
PropertiesHelper(String filename)
          Creates new helper.
 
Method Summary
static Properties filterProperties(Properties properties, String prefix)
           
 int getIntProperty(String key)
           
 long getLongProperty(String key)
           
 Properties getProperties()
           
 String getStringProperty(String key)
           
 String getStringProperty(String key, Object... parameters)
           
static String propertiesToString(Properties properties)
           
static String[] propertiesToVMOptions(Properties properties)
           
static Properties stringToProperties(String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesHelper

public PropertiesHelper(String filename)
                 throws IOException
Creates new helper.

Parameters:
filename - Properties file name.
Throws:
IOException - If failed to open specified file.
Method Detail

getStringProperty

public String getStringProperty(String key)

getStringProperty

public String getStringProperty(String key,
                                Object... parameters)

getIntProperty

public int getIntProperty(String key)

getLongProperty

public long getLongProperty(String key)

getProperties

public Properties getProperties()

propertiesToString

public static String propertiesToString(Properties properties)

stringToProperties

public static Properties stringToProperties(String s)

filterProperties

public static Properties filterProperties(Properties properties,
                                          String prefix)

propertiesToVMOptions

public static String[] propertiesToVMOptions(Properties properties)


Copyright © 2011. All Rights Reserved.