万用工具包hutool-使用java获取文件地址,并读取其中的文件内容
2021-01-08 23:29
阅读:1008
标签:url jdb 函数 artifact 获取文件 depend har 配置 tool
场景:单纯打jar包时输入json参数必须是转义过的,很麻烦,直接从文件中读取不需要手动转义
1、加入pom文件
cn.hutool
hutool-all5.3.5
2、配置setting文件,如(同理,也可以这么配置jdbc信息)
3、main函数下加入
Setting setting = new Setting(new File(fileUrl), CharsetUtil.CHARSET_UTF_8, true);//fileUrl是对应文件的具体地址,如E:/code/f.setting
String uripush=setting.getStr("sendtype");//获取配置文件中的具体参数内容
String json111=setting.getStr("input");
万用工具包hutool-使用java获取文件地址,并读取其中的文件内容
标签:url jdb 函数 artifact 获取文件 depend har 配置 tool
原文地址:https://www.cnblogs.com/Codingdoudou/p/12964418.html
文章来自:搜素材网的编程语言模块,转载请注明文章出处。
文章标题:万用工具包hutool-使用java获取文件地址,并读取其中的文件内容
文章链接:http://soscw.com/essay/41031.html
文章标题:万用工具包hutool-使用java获取文件地址,并读取其中的文件内容
文章链接:http://soscw.com/essay/41031.html
评论
亲,登录后才可以留言!