public class PropsUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static Props |
fromHierarchicalMap(java.util.Map<java.lang.String,java.lang.Object> propsMap)
Convert a hierarchical Map to Prop Object
|
static Props |
fromJSONString(java.lang.String json)
Convert json String to Prop Object
|
static java.lang.String |
getPropertyDiff(Props oldProps,
Props newProps)
The difference between old and new Props
|
static boolean |
isVariableReplacementPattern(java.lang.String value)
Check if the prop value is a variable replacement pattern
|
static Props |
loadPluginProps(java.io.File pluginDir)
Load plugin properties
|
static Props |
loadProps(Props parent,
java.io.File... propFiles)
Load Props
|
static void |
loadPropsBySuffix(java.io.File jobPath,
Props props,
java.lang.String... suffixes)
Load properties from the given path
|
static Props |
loadPropsInDir(java.io.File dir,
java.lang.String... suffixes)
Load job schedules from the given directories
|
static Props |
loadPropsInDir(Props parent,
java.io.File dir,
java.lang.String... suffixes)
Load job schedules from the given directories
|
static Props |
loadPropsInDirs(java.util.List<java.io.File> dirs,
java.lang.String... suffixes)
Load job schedules from the given directories
|
static Props |
newProps(Props parentProps,
java.io.File file)
new Props based on default Props and expand it from external prop file
|
static Props |
newProps(Props parentProps,
java.lang.String filePath)
new Props based on default Props and expand it from external prop file
|
static Props |
resolveProps(Props props)
Resolve Props
|
static java.util.Map<java.lang.String,java.lang.Object> |
toHierarchicalMap(Props props)
Convert a Props object to a hierarchical Map
|
static java.lang.String |
toJSONString(Props props,
boolean localOnly)
Convert props to json string
|
static java.util.Map<java.lang.String,java.lang.String> |
toStringMap(Props props,
boolean localOnly)
Convert props to Map
|
public static Props loadPropsInDir(java.io.File dir, java.lang.String... suffixes)
dir - The directory to look insuffixes - File suffixes to loadpublic static Props loadPropsInDir(Props parent, java.io.File dir, java.lang.String... suffixes)
parent - The parent properties for these propertiesdir - The directory to look insuffixes - File suffixes to loadpublic static Props loadProps(Props parent, java.io.File... propFiles)
parent - parent proppropFiles - prop filespublic static Props loadPluginProps(java.io.File pluginDir)
pluginDir - plugin's Base Directorypublic static Props loadPropsInDirs(java.util.List<java.io.File> dirs, java.lang.String... suffixes)
dirs - The directories to check for propertiessuffixes - The suffixes to loadpublic static void loadPropsBySuffix(java.io.File jobPath,
Props props,
java.lang.String... suffixes)
jobPath - The path to load fromprops - The parent properties for loaded propertiessuffixes - The suffixes of files to loadpublic static boolean isVariableReplacementPattern(java.lang.String value)
public static Props resolveProps(Props props)
props - propspublic static Props newProps(Props parentProps, java.lang.String filePath) throws java.io.IOException
parentProps - parent PropsfilePath - filePathjava.io.IOExceptionpublic static Props newProps(Props parentProps, java.io.File file) throws java.io.IOException
parentProps - parent Propsfile - prop filejava.io.IOExceptionpublic static java.lang.String toJSONString(Props props, boolean localOnly)
props - propslocalOnly - include local prop sets only or notpublic static java.util.Map<java.lang.String,java.lang.String> toStringMap(Props props, boolean localOnly)
props - propslocalOnly - include local prop sets only or notpublic static Props fromJSONString(java.lang.String json) throws java.io.IOException
json - json formatted stringjava.io.IOException - exception on parsing json string to prop objectpublic static Props fromHierarchicalMap(java.util.Map<java.lang.String,java.lang.Object> propsMap)
propsMap - a hierarchical Mappublic static java.util.Map<java.lang.String,java.lang.Object> toHierarchicalMap(Props props)
props - props object