Removed usage of obsoleted ArgumentNullOrEmptyException

This commit is contained in:
Ronald Barendse
2019-10-07 22:10:21 +02:00
parent 8920e10a94
commit ed90e71f76
43 changed files with 394 additions and 307 deletions

View File

@@ -1,15 +1,10 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.Configuration.UmbracoSettings;
using Umbraco.Core.Exceptions;
using Umbraco.Core.Logging;
using Umbraco.Core.Media;
using Umbraco.Core.Models;
namespace Umbraco.Core.IO
@@ -92,7 +87,8 @@ namespace Umbraco.Core.IO
{
if (content == null) throw new ArgumentNullException(nameof(content));
if (propertyType == null) throw new ArgumentNullException(nameof(propertyType));
if (string.IsNullOrWhiteSpace(filename)) throw new ArgumentNullOrEmptyException(nameof(filename));
if (filename == null) throw new ArgumentNullException(nameof(filename));
if (string.IsNullOrWhiteSpace(filename)) throw new ArgumentException("Value can't be empty or consist only of white-space characters.", nameof(filename));
if (filestream == null) throw new ArgumentNullException(nameof(filestream));
// clear the old file, if any
@@ -111,7 +107,8 @@ namespace Umbraco.Core.IO
{
if (content == null) throw new ArgumentNullException(nameof(content));
if (propertyType == null) throw new ArgumentNullException(nameof(propertyType));
if (string.IsNullOrWhiteSpace(sourcepath)) throw new ArgumentNullOrEmptyException(nameof(sourcepath));
if (sourcepath == null) throw new ArgumentNullException(nameof(sourcepath));
if (string.IsNullOrWhiteSpace(sourcepath)) throw new ArgumentException("Value can't be empty or consist only of white-space characters.", nameof(sourcepath));
// ensure we have a file to copy
if (FileExists(sourcepath) == false) return null;