Example #1
0
 /// <inheritdoc/>
 public void Rename(FileInfo file, string newName, bool overWrite)
 {
     Ensure.NotNull(file, nameof(file));
     Ensure.NotNullOrEmpty(newName, nameof(newName));
     using (var transaction = new RenameTransaction(this.GetRenamePairs(file, newName)))
     {
         transaction.Commit(overWrite);
     }
 }
Example #2
0
        /// <inheritdoc/>
        public void Rename(FileInfo file, string newName, bool overWrite)
        {
            if (file is null)
            {
                throw new ArgumentNullException(nameof(file));
            }

            if (string.IsNullOrEmpty(newName))
            {
                throw new ArgumentNullException(nameof(newName));
            }

            using var transaction = new RenameTransaction(this.GetRenamePairs(file, newName));
            transaction.Commit(overWrite);
        }