/// <summary>
/// Checks for invalid path characters in the given path.
/// </summary>
/// <exception cref="System.ArgumentNullException">Thrown if the path is null.</exception>
/// <exception cref="System.ArgumentException">Thrown if the path has invalid characters.</exception>
/// <param name="path">The path to check for invalid characters.</param>
internal static void CheckInvalidPathChars(string path)
{
if (path == null)
{
throw new ArgumentNullException(nameof(path));
}
if (PathInternal.HasIllegalCharacters(path))
{
throw new ArgumentException(SR.Argument_InvalidPathChars, nameof(path));
}
}