File: DirectoryWrapper.cs
Web Access
Project: ..\..\..\src\Cli\Microsoft.DotNet.InternalAbstractions\Microsoft.DotNet.InternalAbstractions.csproj (Microsoft.DotNet.InternalAbstractions)
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
 
using Microsoft.DotNet.InternalAbstractions;
 
namespace Microsoft.Extensions.EnvironmentAbstractions
{
    internal class DirectoryWrapper : IDirectory
    {
        public bool Exists(string path)
        {
            return Directory.Exists(path);
        }
 
        public ITemporaryDirectory CreateTemporaryDirectory()
        {
            return new TemporaryDirectory();
        }
 
        public string CreateTemporarySubdirectory()
        {
            return CreateTemporaryDirectory().DirectoryPath;
        }
 
        public IEnumerable<string> EnumerateDirectories(string path)
        {
            return Directory.EnumerateDirectories(path);
        }
 
        public IEnumerable<string> EnumerateFiles(string path)
        {
            return Directory.EnumerateFiles(path);
        }
 
        public IEnumerable<string> EnumerateFileSystemEntries(string path)
        {
            return Directory.EnumerateFileSystemEntries(path);
        }
 
        public string GetCurrentDirectory()
        {
            return Directory.GetCurrentDirectory();
        }
 
        public void CreateDirectory(string path)
        {
            Directory.CreateDirectory(path);
        }
 
        public void Delete(string path, bool recursive)
        {
            Directory.Delete(path, recursive);
        }
 
        public void Move(string source, string destination)
        {
            Directory.Move(source, destination);
        }
    }
}