dotnet-installer/src/Microsoft.DotNet.InternalAbstractions/FileWrapper.cs
Livar Cunha f4bb13acaa Merge branch 'rel/1.1.0' into merge_rel_110
* rel/1.1.0: (41 commits)
  Updating the Sdk to one that includes the error surfacing work.
  Update NuGet to 4.3.0-preview2-4082
  Update NuGet to 4.3.0-preview1-4081 and SDK to corresponding 1.1.0 based version
  Updating MSBuild to 15.3.0-preview-000246-05 to match VS.
  Updating the global.json creation to use the IFile interface and adding a unit test to cover it.
  Making restore use a config file so that it does not use fallback folders that may exist in the machine.
  Dropping a global.json when running the first run experience with a version that matches the version of the CLI being used in the command that triggered the first run.
  Updating the websdk version for 1.0
  Trying to fix the opensuse42 test failure, where we tried to invoke a tool that target 1.0.4 where the 1.0 runtime is not available.
  Pinning the stage0 to the last build out of rel/1.0.1 and adding a project to download 1.0 dependencies for test assets.
  Updating the branding to rel/1.1.0
  Dummy commit.
  Adding the access token to the lzma url.
  Dummy change to force a build.
  Reverting the msbuild version to the release version.
  Adding the web feed to nuget.config, as some packages failed to mirror and we need a build ASAP.
  Updating the msbuild, SDK and Web SDK versions.
  Dummy commit to kick off the build.
  the FSharp.NET.Sdk version `-bundled` contains only the Sdk dir
  bump f# sdk package version
  ...
2017-06-01 09:43:31 -07:00

49 lines
1.2 KiB
C#

// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.IO;
namespace Microsoft.Extensions.EnvironmentAbstractions
{
internal class FileWrapper: IFile
{
public bool Exists(string path)
{
return File.Exists(path);
}
public string ReadAllText(string path)
{
return File.ReadAllText(path);
}
public Stream OpenRead(string path)
{
return File.OpenRead(path);
}
public Stream OpenFile(
string path,
FileMode fileMode,
FileAccess fileAccess,
FileShare fileShare,
int bufferSize,
FileOptions fileOptions)
{
return new FileStream(path, fileMode, fileAccess, fileShare, bufferSize, fileOptions);
}
public void CreateEmptyFile(string path)
{
using (File.Create(path))
{
}
}
public void WriteAllText(string path, string content)
{
File.WriteAllText(path, content);
}
}
}