public void getAlldeleteOrRemoveFile() throws IOException { List<Attachment> abandonFileList = attachmentService.getAlldeleteOrRemoveFile(); attachmentService.deleteAlldeleteOrRemoveFile(); LiGuangUtils.listToJson(abandonFileList); /** * 删除文件 for (Attachment att : abandonFileList) { File file = new * File(ServletActionContext.getServletContext().getRealPath(att.getFileurl())); File smallfile; * if (LiGuangUtils.isPicture(file.getName())) { smallfile = new * File(ServletActionContext.getServletContext().getRealPath(att.getSmallurl())); if * (smallfile.exists()) { smallfile.delete(); } } if (file.exists()) { file.delete(); } } */ }