Stumps.Server.Data.DataAccess.StumpDelete C# (CSharp) Method

StumpDelete() public method

Deletes an existing stump from a Stumps server.
public StumpDelete ( string serverId, string stumpId ) : void
serverId string The unique identifier for the Stumps server the Stump is located in.
stumpId string The unique identifier for the stump to delete.
return void
        public void StumpDelete(string serverId, string stumpId)
        {
            var stumpsPath = Path.Combine(_storagePath, serverId, DataAccess.StumpsPathName);

            var stumpFileName = Path.Combine(stumpsPath, stumpId + DataAccess.StumpFileExtension);
            var matchFileName = Path.Combine(stumpsPath, stumpId + DataAccess.OriginalRequestBodyFileExtension);
            var responseFileName = Path.Combine(stumpsPath, stumpId + DataAccess.ResponseBodyFileExtension);

            if (File.Exists(stumpFileName))
            {
                File.Delete(stumpFileName);
            }

            if (File.Exists(matchFileName))
            {
                File.Delete(matchFileName);
            }

            if (File.Exists(responseFileName))
            {
                File.Delete(responseFileName);
            }
        }