summaryrefslogtreecommitdiff
path: root/src/Task/FileSystem/FileSystem.cs
blob: 3fd4c992428e191a9a429f782a08a8f92aeb0012 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using System.IO;

namespace AggregateConfigBuildTask
{
    internal sealed class FileSystem : IFileSystem
    {
        /// <inheritdoc/>
        public string[] GetFiles(string path, string searchPattern)
        {
            return Directory.GetFiles(path, searchPattern);
        }

        /// <inheritdoc/>
        public string[] ReadAllLines(string path)
        {
            return File.ReadAllLines(path);
        }

        /// <inheritdoc/>
        public string ReadAllText(string path)
        {
            return File.ReadAllText(path);
        }

        /// <inheritdoc/>
        public void WriteAllText(string path, string text)
        {
            File.WriteAllText(path, text);
        }

        /// <inheritdoc/>
        public bool FileExists(string path)
        {
            return File.Exists(path);
        }

        /// <inheritdoc/>
        public bool DirectoryExists(string directoryPath)
        {
            return Directory.Exists(directoryPath);
        }

        /// <inheritdoc/>
        public void CreateDirectory(string directoryPath)
        {
            Directory.CreateDirectory(directoryPath);
        }

        /// <inheritdoc/>
        public TextReader OpenText(string path)
        {
            return File.OpenText(path);
        }

        /// <inheritdoc/>
        public Stream OpenRead(string inputPath)
        {
            return File.OpenRead(inputPath);
        }
    }
}