enter image description here我怎么能写在资源文件夹中的图像Spring MVC中的项目
@GET
@Path("/welcome1")
@Produces(MediaType.APPLICATION_JSON)
public Response image() {
try {
BufferedImage originalImage = ImageIO.read(new File("F:\\images\\1.jpg"));
ImageIO.write(originalImage, "jpg", new File("resources\img\copyright.jpg"));
} catch (IOException e) {
System.out.println(e.getMessage());
}
return null;
}
我想加载图像形成我的硬盘项目folder.but我得到了 错误(系统无法找到具体的路径)。
错误是:
java.io.FileNotFoundException:资源\ IMG \ copyright.jpg(该 系统不能找到指定的路径)
运行应用程序中没有src文件夹 – Jens