public void Delete([FromRoute] string folder, [FromRoute] string id, [FromQuery] bool unUsed = false) { File file; if (unUsed) { _cmsService.RemoveUnusedFiles(); log.Log(Strings["UNUSED_FILES_REMOVED"]); } else { file = _cmsService.GetFile(id); if (folder.ToLower() != file.Folder.ToLower()) { throw new System.Security.SecurityException("Could not delete file - wrong folder"); } _cmsService.RemoveFile(id); } }