想要获取classpath路径方式: String localPathDir2 = ResourceUtils.getURL("classpath:").getPath(); 想要获取classpath下static路径方式: String localPathDir2 = ResourceUtils.getURL("classpath:static").getPath();
放在static下的资源,可以直接url+端口号/文件名,直接下载文件
例如:
String localPathDir2 = ResourceUtils.getURL("classpath:").getPath(); String localPathDir = localPathDir2 + "static" + File.separator;
http://localhost:9004/22c6f46bef8a49718aeef7fa749b5be6压缩包版本1709290475640.zip