Package org.forgerock.openam.utils
Class MapHelper
- java.lang.Object
-
- org.forgerock.openam.utils.MapHelper
-
public final class MapHelper extends Object
Utility class for operations onMaps.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Map<String,Set<String>>readMap(InputStream is)Read a stream into a map of strings to sets of strings.static Map<String,Set<String>>readMap(String fileName)Read a properties file into a map of strings to sets of strings.
-
-
-
Method Detail
-
readMap
public static Map<String,Set<String>> readMap(String fileName) throws IOException
Read a properties file into a map of strings to sets of strings. Lines whose first non whitespace character is a hash are ignored as comments, while lines which do not contain an assignment are just ignored.- Parameters:
fileName- The property file name- Returns:
- A map of strings to sets of strings
- Throws:
IOException- if there is an IO problem when reading the file (like it doesn't exist, etc.)
-
readMap
public static Map<String,Set<String>> readMap(InputStream is) throws IOException
Read a stream into a map of strings to sets of strings. Lines whose first non whitespace character is a hash are ignored as comments, while lines which do not contain an assignment are just ignored.- Parameters:
is- A stream to read properties from.- Returns:
- A map of strings to sets of strings
- Throws:
IOException- if there is an IO problem when reading the file (like it doesn't exist, etc.)
-
-