test/Shared/FunctionalTests.Transitional/TestHelpers/IOHelpers.cs
/// <summary>
/// Creates the specified directory if it doesn't exist or removes all contents of an existing directory.
/// </summary>
/// <param name="path"> Path to directory to create. </param>
Creates the specified directory if it doesn't exist or removes all contents of an existing directory.
Creates the specified directory if it doesn ' t exist or removes all contents of an existing directory .
[SecuritySafeCritical]
        [PermissionSet(SecurityAction.Assert, Unrestricted = true)]
        public static void EnsureDirectoryEmpty(string path)
        {
            if (Directory.Exists(path))
            {
                SafeDeleteDirectory(path);
            }
            EnsureDirectoryExists(path);
        }
[ SecuritySafeCritical ] [ PermissionSet ( SecurityAction . Assert , Unrestricted = true ) ] public static void EnsureDirectoryEmpty ( string path ) { if ( Directory . Exists ( path ) ) { SafeDeleteDirectory ( path ) ; } EnsureDirectoryExists ( path ) ; }
Creates the specified directory if it doesn't exist or removes all contents of an existing directory.
Creates the specified directory if it doesn ' t exist or removes all contents of an existing directory .
// Calling Directory.Exists demands FileIOPermission (Read flag) for the specified path.
path
string
Path to directory to create.
Path to directory to create .