The CopyFile extension method was not disposing the file stream, so any attempt to delete the source file afterwards would fail.

Removing unused using statements.
This commit is contained in:
Morten Christensen
2014-06-25 16:00:21 +02:00
parent 27764a2c82
commit 12cdd3326a
4 changed files with 4 additions and 7 deletions

View File

@@ -1,6 +1,5 @@
using System;
using System.IO;
using Umbraco.Core.CodeAnnotations;
namespace Umbraco.Core.IO
{
@@ -19,7 +18,10 @@ namespace Umbraco.Core.IO
public static void CopyFile(this IFileSystem fs, string path, string newPath)
{
fs.AddFile(newPath, fs.OpenFile(path));
using (var fileStream = fs.OpenFile(path))
{
fs.AddFile(newPath, fileStream);
}
}
public static string GetExtension(this IFileSystem fs, string path)

View File

@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using Umbraco.Core.CodeAnnotations;
namespace Umbraco.Core.IO
{

View File

@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using Umbraco.Core.CodeAnnotations;
namespace Umbraco.Core.IO
{

View File

@@ -3,10 +3,7 @@ using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Web;
using Umbraco.Core.CodeAnnotations;
using Umbraco.Core.Logging;
using Umbraco.Core.Publishing;
namespace Umbraco.Core.IO
{