public class PropsUtils extends 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 Properties |
collapse(Properties props)
Collapses all the inherited and current properties into a single Properties
object and returns it.
|
static URL[] |
find(String props)
Locates the properties file in the current classpath.
|
static void |
main(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"
|
protected static void |
printUsage()
Prints the usage of this class from the commandline to stdout.
|
static Properties |
read(String props)
Reads properties that inherit from three locations.
|
static String |
toString(Properties props,
String comment)
Outputs the properties as they would be written to a file.
|
public static Properties read(String props) throws Exception
props
- the location of the props file that should be loaded.
e.g.: "weka/core/Utils.props".Exception
- if an error occurs reading the properties files.Utils.readProperties(String)
public static URL[] find(String props)
props
- the props file to locatepublic static Properties collapse(Properties props)
props
- the properties to collapsepublic static String toString(Properties props, String comment)
props
- the properties to turn into a stringcomment
- the comment to outputprotected static void printUsage()
public static void main(String[] args) throws Exception
Exception
Copyright © 2017. All Rights Reserved.