2012-08-20 10:46:32 -01:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Core.IO
|
|
|
|
|
|
{
|
|
|
|
|
|
public static class IFileSystemExtensions
|
|
|
|
|
|
{
|
|
|
|
|
|
internal static long GetSize(this IFileSystem fs, string path)
|
|
|
|
|
|
{
|
|
|
|
|
|
var s = fs.OpenFile(path);
|
|
|
|
|
|
var size = s.Length;
|
|
|
|
|
|
s.Close();
|
|
|
|
|
|
|
|
|
|
|
|
return size;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2012-08-20 11:42:18 -01:00
|
|
|
|
internal static void CopyFile(this IFileSystem fs, string path, string newPath)
|
2012-08-20 10:46:32 -01:00
|
|
|
|
{
|
2012-08-20 11:42:18 -01:00
|
|
|
|
fs.AddFile(newPath, fs.OpenFile(path));
|
2012-08-20 10:46:32 -01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|