Blog blog = (Blog)getModel().get(Constants.BLOG_KEY);
String names[] = request.getParameterValues("name");
String type = request.getParameter("type");
String path = request.getParameter("path");
FileManager fileManager = new FileManager(blog, type);
FileManager themeFileManager = new FileManager(blog, FileMetaData.BLOG_DATA);
if (names != null) {
for (String name : names) {
try {
fileManager.deleteFile(path, name);
// if it's a theme file, also delete the copy in blog.dir/theme
if (type.equals(FileMetaData.THEME_FILE)) {
themeFileManager.deleteFile("/theme" + path, name);
}
blog.info("File \"" + StringUtils.transformHTML(name) + "\" removed.");
} catch (IllegalFileAccessException e) {
return new ForbiddenView();