public class PropertiesHandler extends Object
Also, you can use this handler individually, to create or update .properties format file.
| Constructor and Description |
|---|
PropertiesHandler() |
| Modifier and Type | Method and Description |
|---|---|
static Properties |
load(InputStreamReader inputStreamReader)
Load .properties file and return a
Properties object |
static Properties |
load(String path)
Load .properties file and return a
Properties object |
static void |
save(String path,
Map<String,String> params)
Save a java map to external in .properties format.
|
static void |
save(String path,
Properties properties)
Save a
Properties object to external file. |
static Properties |
update(Properties properties,
Map<String,String> params)
Update a
Properties object with a java map. |
public static Properties load(InputStreamReader inputStreamReader) throws IOException
Properties objectinputStreamReader - the input stream of external fileProperties objectIOException - if an error occurred when reading from the input stream.public static Properties load(String path) throws IOException
Properties objectpath - the path of external fileProperties objectIOException - file not exists or if an error occurred when reading from the input stream.public static Properties update(Properties properties, Map<String,String> params)
Properties object with a java map.properties - the propertiesparams - java mappublic static void save(String path, Properties properties) throws IOException
Properties object to external file.path - external locationproperties - a Properties objectIOException - if writing this property list to the specified output stream throws an IOException.public static void save(String path, Map<String,String> params) throws IOException
path - external locationparams - java mapIOException - if writing this property list to the specified output stream throws an IOException.Copyright © 2019. All rights reserved.