Amazon.S3.IO.S3FileInfo.MoveToLocal C# (CSharp) Method

MoveToLocal() public method

Moves the file from S3 to the local file system in the location indicated by the path parameter.
If the file already exists locally.
public MoveToLocal ( string path ) : FileInfo
path string The location on the local file system to move the file to.
return System.IO.FileInfo
        public FileInfo MoveToLocal(string path)
        {
            FileInfo ret = CopyToLocal(path, false);
            Delete();
            return ret;
        }

Usage Example

 public void RenameFile(string oldPath, string newPath)
 {
     oldPath = CleanPath(oldPath);
     newPath = CleanPath(newPath);
     var file = new S3FileInfo(_client, _amazonS3StorageConfiguration.AWSFileBucket, oldPath);
     file.MoveToLocal(newPath);
     
 }