Package com.sun.javatest.util
Class PropertyUtils
java.lang.Object
com.sun.javatest.util.PropertyUtils
A collection of utility methods related to
java.util.Properties
loading, saving and transformation.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertToStringProps
(Properties properties) Converts the given properties toMap<String, String>
instance picking only string properties from the givenjava.util.Properties
instance.load
(InputStream inputStream) Reads a property list from the given input stream usingjava.util.Properties.load(java.io.InputStream inStream)
method and stores properties into aMap<String, String>
that is returned.Reads a property list with the given reader usingjava.util.Properties.load(java.io.Reader reader)
method and stores properties into aMap<String, String>
that is returned.loadSorted
(InputStream inputStream) Reads a property list from the given input stream usingjava.util.Properties.load(java.io.InputStream inStream)
method and stores string properties into aSortedMap<String, String>
that is returned.static void
Utility method that writes the given map of strings to the given output stream with provided comments usingjava.util.Properties.store(java.io.OutputStream, String)
method.
-
Constructor Details
-
PropertyUtils
public PropertyUtils()
-
-
Method Details
-
store
public static void store(Map<String, String> stringProps, OutputStream out, String comments) throws IOExceptionUtility method that writes the given map of strings to the given output stream with provided comments usingjava.util.Properties.store(java.io.OutputStream, String)
method.- Throws:
IOException
-
load
Reads a property list from the given input stream usingjava.util.Properties.load(java.io.InputStream inStream)
method and stores properties into aMap<String, String>
that is returned.- Throws:
IOException
-
load
Reads a property list with the given reader usingjava.util.Properties.load(java.io.Reader reader)
method and stores properties into aMap<String, String>
that is returned.- Throws:
IOException
-
loadSorted
Reads a property list from the given input stream usingjava.util.Properties.load(java.io.InputStream inStream)
method and stores string properties into aSortedMap<String, String>
that is returned.- Throws:
IOException
-
convertToStringProps
Converts the given properties toMap<String, String>
instance picking only string properties from the givenjava.util.Properties
instance.
-