public class SohelpBootResourceDBServiceImpl extends Object implements ISohelpBootResourceService
| 构造器和说明 |
|---|
SohelpBootResourceDBServiceImpl() |
| 限定符和类型 | 方法和说明 |
|---|---|
Map<String,Object> |
add(String filePath,
String fileContent)
创建配置资源
|
void |
deleteBatch(String filePath)
删除所有匹配的资源
|
void |
deleteByPath(String filePath)
根据文件路径删除配置资源。
|
boolean |
exists(String filePath)
判断文件是否存在
|
com.alibaba.fastjson.JSONObject |
getByPath(String path)
根据文件名获取文件内容
|
<T> T |
getByPath(String filePath,
Class<T> cls)
根据路径获取对象
|
List<com.alibaba.fastjson.JSONObject> |
listByPath(String filePath)
读取配置资源,列出当前目录的资源
|
<T> List<T> |
listByPath(String filePath,
Class<T> cls)
根据给定的文件路径和类类型读取配置资源,并将其转换为指定类型的对象列表。
|
List<com.alibaba.fastjson.JSONObject> |
listByRegex(String filePath,
String regex)
通过正则表达式从指定路径下筛选出符合条件的JSON对象列表
|
<T> List<T> |
listByRegex(String filePath,
String regex,
Class<T> cls)
根据给定的文件路径和类类型读取配置资源,并将其转换为指定类型的对象列表。
|
void |
renamePath(String srcFilePath,
String newFilePath)
修改路径
|
Map<String,Object> |
save(String filePath,
Map<String,Object> formMap)
保存配置资源
|
Map<String,Object> |
save(String filePath,
String fileJson)
保存配置资源。
|
Map<String,Object> |
updateByPath(String filePath,
String fileContent)
更新配置资源
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconvertClass, formatFilePath, readOnly@Comment(value="\u5224\u65ad\u6587\u4ef6\u662f\u5426\u5b58\u5728") public boolean exists(String filePath)
exists 在接口中 ISohelpBootResourceServicefilePath - 文件路径@Comment(value="\u6839\u636e\u6587\u4ef6\u540d\u83b7\u53d6\u6587\u4ef6\u5185\u5bb9") public com.alibaba.fastjson.JSONObject getByPath(String path)
getByPath 在接口中 ISohelpBootResourceServicepath - 文件路径@Comment(value="\u6839\u636e\u8def\u5f84\u83b7\u53d6\u5bf9\u8c61") public <T> T getByPath(String filePath, Class<T> cls) throws BusiException, SQLException
getByPath 在接口中 ISohelpBootResourceServiceT - 目标对象的类型filePath - 文件路径cls - 目标对象的类型BusiException - 业务异常SQLException - SQL异常@Comment(value="\u4fdd\u5b58\u914d\u7f6e\u8d44\u6e90") public Map<String,Object> save(String filePath, Map<String,Object> formMap) throws SQLException, BusiException
save 在接口中 ISohelpBootResourceServicefilePath - 配置文件的路径formMap - 表单数据,以键值对的形式存储SQLException - 数据库操作异常BusiException - 业务异常@Comment(value="\u4fdd\u5b58\u914d\u7f6e\u8d44\u6e90") public Map<String,Object> save(String filePath, String fileJson) throws SQLException, BusiException
save 在接口中 ISohelpBootResourceServicefilePath - 文件路径fileJson - 文件内容,以JSON格式表示SQLException - 如果数据库操作出现异常,则抛出此异常BusiException - 如果业务逻辑处理出现异常,则抛出此自定义异常@Comment(value="\u521b\u5efa\u914d\u7f6e\u8d44\u6e90") public Map<String,Object> add(String filePath, String fileContent) throws SQLException, BusiException
add 在接口中 ISohelpBootResourceServicefilePath - 资源文件的路径fileContent - 资源文件的内容SQLException - 数据库异常BusiException - 业务异常@Comment(value="\u4fee\u6539\u8def\u5f84") public void renamePath(String srcFilePath, String newFilePath) throws SQLException, BusiException
renamePath 在接口中 ISohelpBootResourceServicesrcFilePath - 原路径newFilePath - 新路径SQLException - SQL异常BusiException - 业务异常@Comment(value="\u66f4\u65b0\u914d\u7f6e\u8d44\u6e90") public Map<String,Object> updateByPath(String filePath, String fileContent) throws SQLException, BusiException
updateByPath 在接口中 ISohelpBootResourceServicefilePath - 配置资源的路径,例如: filePath=/datasource/32932032009329fileContent - 配置资源的内容SQLException - 如果数据库操作出现异常BusiException - 如果资源设置为只读模式,抛出异常public List<com.alibaba.fastjson.JSONObject> listByRegex(String filePath, String regex) throws SQLException
listByRegex 在接口中 ISohelpBootResourceServicefilePath - 指定路径regex - 正则表达式SQLException - SQL异常@Comment(value="\u8bfb\u53d6\u914d\u7f6e\u8d44\u6e90") public List<com.alibaba.fastjson.JSONObject> listByPath(String filePath)
listByPath 在接口中 ISohelpBootResourceServicefilePath - 资源路径@Comment(value="\u8bfb\u53d6\u914d\u7f6e\u8d44\u6e90") public <T> List<T> listByPath(String filePath, Class<T> cls) throws SQLException
listByPath 在接口中 ISohelpBootResourceServiceT - 返回对象列表的类型filePath - 文件路径cls - 要转换成的类类型SQLException - 如果读取文件或转换对象时发生SQL异常@Comment(value="\u6839\u636e\u7ed9\u5b9a\u7684\u6587\u4ef6\u8def\u5f84\u548c\u7c7b\u7c7b\u578b\u8bfb\u53d6\u914d\u7f6e\u8d44\u6e90\uff0c\u5e76\u5c06\u5176\u8f6c\u6362\u4e3a\u6307\u5b9a\u7c7b\u578b\u7684\u5bf9\u8c61\u5217\u8868\u3002") public <T> List<T> listByRegex(String filePath, String regex, Class<T> cls) throws SQLException
listByRegex 在接口中 ISohelpBootResourceServiceT - 返回对象列表的类型filePath - 文件路径cls - 要转换成的类类型regex - 正则表达式SQLException - 如果读取文件或转换对象时发生SQL异常@Comment(value="\u6839\u636e\u6587\u4ef6\u8def\u5f84\u5220\u9664\u914d\u7f6e\u8d44\u6e90") public void deleteByPath(String filePath) throws BusiException
deleteByPath 在接口中 ISohelpBootResourceServicefilePath - 文件路径BusiException - 如果删除过程中发生业务异常,则抛出此异常@Comment(value="\u8981\u5220\u9664\u8d44\u6e90\u7684\u8def\u5f84\u524d\u7f00") public void deleteBatch(String filePath) throws BusiException
deleteBatch 在接口中 ISohelpBootResourceServicefilePath - 要删除资源的路径前缀BusiException - 如果发生业务异常时抛出Copyright © 2025. All rights reserved.