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