springboot read at resource files

 

ClassPathResource classPathResource = new ClassPathResource("template/demo/200000168-check-response.xml");
            InputStream inputStream = classPathResource.getInputStream();
            responseXml = new String(FilesUtil.read(inputStream), Cons.GBK);

 

Guess you like

Origin www.cnblogs.com/xiluhua/p/12080047.html