Spring 简单读取文件
Resource resource = (Resource) new ClassPathResource("/register.txt"); EncodedResource enc = new EncodedResource(resource,"UTF-8"); String content = ""; try{ content = FileCopyUtils.copyToString(enc.getReader()); }catch(Exception e){ e.printStackTrace(); } return content;
------------------------------
Brant Liu
lbf1988@qq.com
有梦想的码农
Brant Liu
lbf1988@qq.com
有梦想的码农