Amazon.S3.IO.S3FileInfo.Delete C# (CSharp) Метод

Delete() публичный Метод

Deletes the from S3.
public Delete ( ) : void
Результат void
        public void Delete()
        {
            if (Exists)
            {
                var deleteObjectRequest = new DeleteObjectRequest
                {
                    BucketName = bucket,
                    Key = S3Helper.EncodeKey(key)
                };
                deleteObjectRequest.BeforeRequestEvent += S3Helper.FileIORequestEventHandler;
                s3Client.DeleteObject(deleteObjectRequest);

                Directory.Create();
            }
        }

Usage Example

 public void DeleteFile(string path)
 {
     path = CleanPath(path);
     var file = new S3FileInfo(_client, _amazonS3StorageConfiguration.AWSFileBucket, path);
     file.Delete();
     
 }