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

Replace() public method

Replaces the destination file with the content of this file and then deletes the orignial file. If a backupDir is specifed then the content of destination file is backup to it.
public Replace ( S3DirectoryInfo destDir, S3DirectoryInfo backupDir ) : S3FileInfo
destDir S3DirectoryInfo Where the contents of this file will be copy to.
backupDir S3DirectoryInfo If specified the destFile is backup to it.
return S3FileInfo
        public S3FileInfo Replace(S3DirectoryInfo destDir, S3DirectoryInfo backupDir)
        {
            S3FileInfo ret = Replace(
                new S3FileInfo(destDir.S3Client, destDir.BucketName, string.Format(CultureInfo.InvariantCulture, "{0}{1}", destDir.ObjectKey, Name)),
                backupDir == null ? null : new S3FileInfo(backupDir.S3Client, backupDir.BucketName, string.Format(CultureInfo.InvariantCulture, "{0}{1}", backupDir.ObjectKey, Name)));
            return ret;
        }

Same methods

S3FileInfo::Replace ( S3FileInfo destFile, S3FileInfo backupFile ) : S3FileInfo
S3FileInfo::Replace ( string destinationBucket, string destinationKey, string backupBucket, string backupKey ) : S3FileInfo