public class PropsUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static boolean |
DEBUG
whether to output some debug information.
|
Constructor and Description |
---|
PropsUtils() |
Modifier and Type | Method and Description |
---|---|
static java.util.Properties |
collapse(java.util.Properties props)
Collapses all the inherited and current properties into a single Properties
object and returns it.
|
static java.net.URL[] |
find(java.lang.String props)
Locates the properties file in the current classpath.
|
static void |
main(java.lang.String[] args)
Allows some basic operations on properties files:
read <props>- reads the specified props file and outputs it,
e.g., "read meka/gui/goe/MekaEditors.props"
find <props>- finds all occurrences of the specified props
file and outputs them, e.g., "find meka/gui/goe/MekaEditors.props"
|
static java.util.Properties |
read(java.lang.String props)
Reads properties that inherit from three locations.
|
static java.lang.String |
toString(java.util.Properties props,
java.lang.String comment)
Outputs the properties as they would be written to a file.
|
public static java.util.Properties read(java.lang.String props) throws java.lang.Exception
props
- the location of the props file that should be loaded.
e.g.: "weka/core/Utils.props".java.lang.Exception
- if an error occurs reading the properties files.Utils.readProperties(String)
public static java.net.URL[] find(java.lang.String props)
props
- the props file to locatepublic static java.util.Properties collapse(java.util.Properties props)
props
- the properties to collapsepublic static java.lang.String toString(java.util.Properties props, java.lang.String comment)
props
- the properties to turn into a stringcomment
- the comment to outputpublic static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception