use of net.jforum.dao.SmilieDAO in project jforum2 by rafaelsteil.
the class SmiliesAction method delete.
public void delete() {
String[] ids = this.request.getParameterValues("id");
if (ids != null) {
SmilieDAO dao = DataAccessDriver.getInstance().newSmilieDAO();
for (int i = 0; i < ids.length; i++) {
int id = Integer.parseInt(ids[i]);
Smilie s = dao.selectById(id);
dao.delete(id);
File smilieFile = new File(s.getDiskName());
File fileToDelete = new File(SystemGlobals.getApplicationPath() + "/" + SystemGlobals.getValue(ConfigKeys.SMILIE_IMAGE_DIR) + "/" + smilieFile.getName());
if (fileToDelete.exists()) {
fileToDelete.delete();
}
}
}
SmiliesRepository.loadSmilies();
this.list();
}