org.eclipse.gemini.blueprint.test.internal.util
Class PropertiesUtil

java.lang.Object
  extended by org.eclipse.gemini.blueprint.test.internal.util.PropertiesUtil

public abstract class PropertiesUtil
extends Object

Loads a property file performing key expansion. Provides simple property substitution, without support for inner or nested placeholders. Also, the algorithm does only one parsing so derivative placeholders are not supported.

Author:
Costin Leau

Constructor Summary
PropertiesUtil()
           
 
Method Summary
static Properties expandProperties(Properties props)
          Apply placeholder expansion to the given properties object.
static Properties filterKeysStartingWith(Properties properties, String prefix)
          Filter/Eliminate keys that start with the given prefix.
static Properties filterValuesStartingWith(Properties properties, String prefix)
          Filter/Eliminate keys that have a value that starts with the given prefix.
static Properties loadAndExpand(org.springframework.core.io.Resource resource)
          Shortcut method - loads a property object from the given input stream and applies property expansion.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesUtil

public PropertiesUtil()
Method Detail

loadAndExpand

public static Properties loadAndExpand(org.springframework.core.io.Resource resource)
Shortcut method - loads a property object from the given input stream and applies property expansion. The returned properties object preserves order at the expense of speed.

Parameters:
resource -
Returns:

filterKeysStartingWith

public static Properties filterKeysStartingWith(Properties properties,
                                                String prefix)
Filter/Eliminate keys that start with the given prefix.

Parameters:
properties -
prefix -
Returns:

filterValuesStartingWith

public static Properties filterValuesStartingWith(Properties properties,
                                                  String prefix)
Filter/Eliminate keys that have a value that starts with the given prefix.

Parameters:
properties -
prefix -
Returns:

expandProperties

public static Properties expandProperties(Properties props)
Apply placeholder expansion to the given properties object. Will return a new properties object, containing the expanded entries. Note that both keys and values will be expanded.

Parameters:
props -
Returns:


Copyright © 2006-2013. All Rights Reserved.