public class FileServerExt : FileServer
{
private class FilesystemWrapper : IFilesystem
{
private readonly IFilesystem _inner;
public FilesystemWrapper(IFilesystem inner)
{
_inner = inner;
}
void IFilesystem.Close(IHandle handle)
{
_inner.Close(handle);
}
void IFilesystem.CreateDirectory(string path)
{
_inner.CreateDirectory(path);
}
void IFilesystem.DeleteDirectory(string path)
{
_inner.DeleteDirectory(path);
}
void IFilesystem.DeleteFile(string path)
{
_inner.DeleteFile(path);
}
FilesystemInfo IFilesystem.GetFilesystemInfo()
{
return _inner.GetFilesystemInfo();
}
ItemInfo IFilesystem.GetItemInfo(string path)
{
return _inner.GetItemInfo(path);
}
string IFilesystem.Normalize(string absolutePath)
{
return _inner.Normalize(absolutePath);
}
IHandle IFilesystem.OpenDirectory(string path, string mask)
{
return _inner.OpenDirectory(path, mask);
}
IHandle IFilesystem.OpenFile(string path, FileOpenMode openMode, FileAccessMode accessMode)
{
return _inner.OpenFile(path, openMode, accessMode);
}
int IFilesystem.Read(IHandle handle, byte[] buffer, int offset, int count)
{
return _inner.Read(handle, buffer, offset, count);
}
ItemInfo IFilesystem.ReadNextItem(IHandle handle)
{
return _inner.ReadNextItem(handle);
}
void IFilesystem.Rename(string sourcePath, string targetPath)
{
_inner.Rename(sourcePath, targetPath);
}
string IFilesystem.ResolvePath(string path, string relativePath)
{
return _inner.ResolvePath(path, relativePath);
}
long IFilesystem.Seek(IHandle handle, FileSeekOrigin origin, long offset)
{
return _inner.Seek(handle, origin, offset);
}
void IFilesystem.SetItemInfo(string path, ItemInfo info)
{
_inner.SetItemInfo(path, info);
}
void IFilesystem.SetItemInfo(IHandle handle, ItemInfo info)
{
_inner.SetItemInfo(handle, info);
}
void IFilesystem.Write(IHandle handle, byte[] buffer, int offset, int count)
{
_inner.Write(handle, buffer, offset, count);
}
}
protected override IFilesystem GetFilesystem(ServerUser user)
{
IFilesystem inner = base.GetFilesystem(user);
IFilesystem outer = new FilesystemWrapper(inner);
return outer;
}
}