2012-08-13 10:04:31 -01:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Core.IO
|
|
|
|
|
|
{
|
2013-01-15 01:19:51 +03:00
|
|
|
|
public interface IFileSystem
|
2012-08-13 10:04:31 -01:00
|
|
|
|
{
|
2012-08-14 09:11:49 -01:00
|
|
|
|
IEnumerable<string> GetDirectories(string path);
|
|
|
|
|
|
|
2012-08-13 10:04:31 -01:00
|
|
|
|
void DeleteDirectory(string path);
|
|
|
|
|
|
|
|
|
|
|
|
void DeleteDirectory(string path, bool recursive);
|
|
|
|
|
|
|
2012-08-14 09:11:49 -01:00
|
|
|
|
bool DirectoryExists(string path);
|
2016-01-26 14:18:30 +01:00
|
|
|
|
|
2012-08-14 09:11:49 -01:00
|
|
|
|
void AddFile(string path, Stream stream);
|
2012-08-13 10:04:31 -01:00
|
|
|
|
|
2016-01-26 14:18:30 +01:00
|
|
|
|
void AddFile(string path, Stream stream, bool overrideIfExists);
|
2012-08-13 10:04:31 -01:00
|
|
|
|
|
2012-08-14 09:11:49 -01:00
|
|
|
|
IEnumerable<string> GetFiles(string path);
|
|
|
|
|
|
|
|
|
|
|
|
IEnumerable<string> GetFiles(string path, string filter);
|
|
|
|
|
|
|
|
|
|
|
|
Stream OpenFile(string path);
|
2012-08-13 10:04:31 -01:00
|
|
|
|
|
|
|
|
|
|
void DeleteFile(string path);
|
|
|
|
|
|
|
|
|
|
|
|
bool FileExists(string path);
|
|
|
|
|
|
|
2012-08-14 09:11:49 -01:00
|
|
|
|
string GetRelativePath(string fullPathOrUrl);
|
2012-08-13 10:04:31 -01:00
|
|
|
|
|
2012-08-14 09:11:49 -01:00
|
|
|
|
string GetFullPath(string path);
|
2012-08-13 10:04:31 -01:00
|
|
|
|
|
2012-08-14 09:11:49 -01:00
|
|
|
|
string GetUrl(string path);
|
2012-08-13 10:04:31 -01:00
|
|
|
|
|
|
|
|
|
|
DateTimeOffset GetLastModified(string path);
|
|
|
|
|
|
|
|
|
|
|
|
DateTimeOffset GetCreated(string path);
|
2016-09-16 16:18:59 +02:00
|
|
|
|
|
|
|
|
|
|
long GetSize(string path);
|
2016-11-03 10:39:21 +01:00
|
|
|
|
|
|
|
|
|
|
// TODO: implement these
|
|
|
|
|
|
//
|
|
|
|
|
|
//void CreateDirectory(string path);
|
|
|
|
|
|
//
|
|
|
|
|
|
//// move or rename, directory or file
|
|
|
|
|
|
//void Move(string source, string target);
|
2016-09-16 16:18:59 +02:00
|
|
|
|
}
|
2012-08-13 10:04:31 -01:00
|
|
|
|
}
|