public class PropertyUtils extends Object
| 构造器和说明 |
|---|
PropertyUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static List<com.gitee.aachen0.util.PropertyUtils.KeyValue> |
getList(InputStreamReader isr)
从一个properties文件的输入流获取一个包含键值对的List集合
因为原生的properties提供的是set,如果需要按原始顺序排列的键值对集合,就用这个方法 |
static Map<String,String> |
getMap(String propPath)
从一个properties文件中获取一个Map集合
|
static boolean |
mapToProp(Map<String,String> map,
String propPath,
String comments)
将一个Map的数据持久化到properties文件内,Map内容请使用UTF-8编码方式
|
static boolean |
mapUpdateToProp(Map<String,String> map,
String propPath,
String comments)
将一个Map的数据添加到一个properties文件内,Map内容请使用UTF-8编码方式
|
public static Map<String,String> getMap(String propPath) throws IOException
propPath - 需要读取的properties文件IOException - IO异常public static boolean mapToProp(Map<String,String> map, String propPath, String comments) throws IOException
map - 要存放的MappropPath - properties文件路径comments - 注释IOException - IO异常public static boolean mapUpdateToProp(Map<String,String> map, String propPath, String comments) throws IOException
map - 要添加的MappropPath - properties文件路径comments - 注释IOException - IO异常public static List<com.gitee.aachen0.util.PropertyUtils.KeyValue> getList(InputStreamReader isr)
isr - properties文件的输入字符流Copyright © 2019. All Rights Reserved.