public class FilePropertyReader extends java.lang.Object implements PropertyReader
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String[] |
filenames
Array of filenames to load properties from
|
| Constructor and Description |
|---|
FilePropertyReader(java.lang.String filename)
Construct a FilePropertyReader with a single filename to read from.
|
FilePropertyReader(java.lang.String[] filenames)
Construct a FilePropertyReader with an array of filenames
to read from.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.io.InputStream |
getInputStream(java.lang.String filename)
Get an input stream for the given filename.
|
protected void |
loadProperties(java.util.Properties props,
java.lang.String filename)
Load properties from a file into a properties map.
|
java.util.Map |
readProperties()
Read properties from each specified filename
|
protected java.lang.String[] filenames
public FilePropertyReader(java.lang.String[] filenames)
filenames - Filenames to load properties frompublic FilePropertyReader(java.lang.String filename)
filename - Filename to load properties fromprotected java.io.InputStream getInputStream(java.lang.String filename)
throws java.io.IOException
filename - File name to get input stream for.java.io.IOException - Failed to get input stream for file.protected void loadProperties(java.util.Properties props,
java.lang.String filename)
throws java.io.IOException
props - Properties map to load properties into.filename - Filename to read properties from.java.io.IOException - Failed to load properties from filename.java.lang.IllegalArgumentException - Filename is invalid.public java.util.Map readProperties()
throws PropertyException,
java.io.IOException
readProperties in interface PropertyReaderPropertyException - Failed to read properties.java.io.IOException - I/O error while reading properties.