Package org.cyclos.server.utils
Class PropertiesHelper
- java.lang.Object
-
- org.cyclos.server.utils.PropertiesHelper
-
public class PropertiesHelper extends Object
Contains helper methods forProperties
-
-
Constructor Summary
Constructors Constructor Description PropertiesHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Map<String,String>asMap(Properties properties)Converts the given properties to a Mapstatic Propertiesfrom(InputStream in)Parses the given input stream as aPropertiesobjectstatic Propertiesfrom(Reader reader)Parses the given reader as aPropertiesobjectstatic Propertiesfrom(String string)Parses the given string as aPropertiesobjectstatic PropertiesgetSubProperties(Properties properties, String keyPrefix)Returns a new properties object with the sub-properties of the given properties For example, if there are the sub properties: "a.b.c=1", "a.b.d=2" and "a.b.e=3", and the keyPrefix is "a.b.", the resulting properties will be: "c=1", "d=2" and "e=3".static StringtoString(Properties properties)Returns the properties as string
-
-
-
Method Detail
-
asMap
public static Map<String,String> asMap(Properties properties)
Converts the given properties to a Map
-
from
public static Properties from(InputStream in)
Parses the given input stream as aPropertiesobject
-
from
public static Properties from(Reader reader)
Parses the given reader as aPropertiesobject
-
from
public static Properties from(String string)
Parses the given string as aPropertiesobject
-
getSubProperties
public static Properties getSubProperties(Properties properties, String keyPrefix)
Returns a new properties object with the sub-properties of the given properties For example, if there are the sub properties: "a.b.c=1", "a.b.d=2" and "a.b.e=3", and the keyPrefix is "a.b.", the resulting properties will be: "c=1", "d=2" and "e=3".
-
toString
public static String toString(Properties properties)
Returns the properties as string
-
-