String filePath = ResourceUtils.getFile("classpath:static/D/XXX/XXX.png").getPath(); file = new File(filePath);