public class PropertyUtil extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
PropertyUtil.Listener
This is the callback interface, used for sending notifications of
changes in the properties file.
|
static class |
PropertyUtil.Test |
Constructor and Description |
---|
PropertyUtil() |
Modifier and Type | Method and Description |
---|---|
static Properties |
getProperties(File file)
Read in a properties file
|
static Properties |
getProperties(File file,
PropertyUtil.Listener listener)
Read in a properties file, and register for update notifications.
|
static Properties |
getProperties(String fileName)
Read in a properties file
|
static Properties |
getProperties(String fileName,
PropertyUtil.Listener listener)
Read in a properties file, and register for update notifications.
|
static void |
stopListening(File file,
PropertyUtil.Listener listener)
Stop listenening for updates
|
static void |
stopListening(String fileName,
PropertyUtil.Listener listener)
Stop listenening for updates
|
public static Properties getProperties(File file) throws IOException
file
- the properties fileIOException
- - subclass 'FileNotFoundException' if the file
does not exist or can't be opened, and 'IOException' if there is
a problem loading the properties file.public static Properties getProperties(String fileName) throws IOException
fileName
- the properties fileIOException
- - subclass 'FileNotFoundException' if the file
does not exist or can't be opened, and 'IOException' if there is
a problem loading the properties file.public static Properties getProperties(File file, PropertyUtil.Listener listener) throws IOException
file
- the properties filenotify
- if not null, this is a callback interface that is used for
notifications of changesIOException
- - subclass 'FileNotFoundException' if the file
does not exist or can't be opened, and 'IOException' if there is
a problem loading the properties file.public static Properties getProperties(String fileName, PropertyUtil.Listener listener) throws IOException
fileName
- the properties filenotify
- if not null, this is a callback interface that is used for
notifications of changesIOException
- - subclass 'FileNotFoundException' if the file
does not exist or can't be opened, and 'IOException' if there is
a problem loading the properties file.public static void stopListening(File file, PropertyUtil.Listener listener)
file
- the properties filenotify
- if not null, this is a callback interface that was used for
notifications of changespublic static void stopListening(String fileName, PropertyUtil.Listener listener)
fileName
- the properties filenotify
- if not null, this is a callback interface that was used for
notifications of changesCopyright © 2017. All rights reserved.