//以resource/static包下为例:
ClassPathResource resource = new ClassPathResource("static" + File.separator + "id_rsa.txt");
//获取流
InputStream ins = resource.getInputStream();
//获取路径
String path = resource.getURL().getPath();
//以resource/static包下为例:
ClassPathResource resource = new ClassPathResource("static" + File.separator + "id_rsa.txt");
//获取流
InputStream ins = resource.getInputStream();
//获取路径
String path = resource.getURL().getPath();