Bloom.Edit.AudioRecording.HandleDeleteSegment C# (CSharp) Method

HandleDeleteSegment() private method

Delete a file (typically a recording, as requested by the Clear button in the talking book tool)
private HandleDeleteSegment ( ApiRequest request ) : void
request Bloom.Api.ApiRequest
return void
        private void HandleDeleteSegment(ApiRequest request)
        {
            var path = GetPathToSegment(request.RequiredParam("id"));
            if(!RobustFile.Exists(path))
            {
                request.Succeeded();
            }
            else
            {
                try
                {
                    RobustFile.Delete(path);
                    request.Succeeded();
                }
                catch(IOException e)
                {
                    var msg =
                        string.Format(
                            LocalizationManager.GetString("Errors.ProblemDeletingFile", "Bloom had a problem deleting this file: {0}"), path);
                    ErrorReport.NotifyUserOfProblem(e, msg + Environment.NewLine + e.Message);
                }
            }
        }