if ("".equals(filename))
throw new OperationAbortedEx("Empty filename. Unable to delete resource.");
// Remove the file and update the file upload/downloads tables
IResourceRemoveHandler removeHook = (IResourceRemoveHandler) context.getApplicationContext().getBean("resourceRemoveHandler");
removeHook.onDelete(context, request, Integer.parseInt(id), filename, access);
// Set parameter and process metadata to remove reference to the uploaded file
request.getParameterMap().put("name", new String[]{filename});
request.getParameterMap().put("protocol", new String[]{"WWW:DOWNLOAD-1.0-http--download"});