/// <summary>
        /// Checks if a file name is valid.
        /// </summary>
        /// <param name="fileName">A string representing the file name to validate.</param>
        public static void ValidateFileName(string fileName)
        {
            NameValidator.ValidateFileDirectoryHelper(fileName, SR.File);

            if (fileName.EndsWith("/", StringComparison.Ordinal))
            {
                throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, SR.InvalidResourceName, SR.File));
            }

            foreach (string s in NameValidator.ReservedFileNames)
            {
                if (s.Equals(fileName, StringComparison.OrdinalIgnoreCase))
                {
                    throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, SR.InvalidResourceReservedName, SR.File));
                }
            }
        }
 /// <summary>
 /// Checks if a directory name is valid.
 /// </summary>
 /// <param name="directoryName">A string representing the directory name to validate.</param>
 public static void ValidateDirectoryName(string directoryName)
 {
     NameValidator.ValidateFileDirectoryHelper(directoryName, SR.Directory);
 }