AWSSDK_CoreCLR.UnitTests.EndpointCustomizationTestClass.CreateEndpointCustomizationFile C# (CSharp) Method

CreateEndpointCustomizationFile() private method

private CreateEndpointCustomizationFile ( ) : FileInfo
return System.IO.FileInfo
        private FileInfo CreateEndpointCustomizationFile()
        {
            string customizationResourceName = "UnitTests.endpoint.customization.json";
            FileInfo fi = new FileInfo(Path.Combine(Path.GetTempPath(), Path.GetTempFileName()));

            using (StreamReader resStream = new StreamReader(Utils.GetAssemblyResourceStream(customizationResourceName)))
            using (Stream stream = new FileStream(fi.FullName, FileMode.OpenOrCreate))
            using (StreamWriter fileStreamWriter = new StreamWriter(stream))
            {
                while (!resStream.EndOfStream)
                { 
                    fileStreamWriter.WriteLine(resStream.ReadLine());
                }
            }

            return fi;
        }
    }