forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileSystemVirtualFile.cs
More file actions
39 lines (32 loc) · 987 Bytes
/
FileSystemVirtualFile.cs
File metadata and controls
39 lines (32 loc) · 987 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using System.IO;
namespace ServiceStack.Razor.VirtualPath
{
public class FileSystemVirtualFile : AbstractVirtualFileBase
{
protected FileInfo BackingFile;
public override string Name
{
get { return BackingFile.Name; }
}
public override string RealPath
{
get { return BackingFile.FullName; }
}
public override DateTime LastModified
{
get { return BackingFile.LastWriteTime; }
}
public FileSystemVirtualFile(IVirtualPathProvider owningProvider, IVirtualDirectory parentDirectory, FileInfo fInfo)
: base(owningProvider, parentDirectory)
{
if (fInfo == null)
throw new ArgumentNullException("fInfo");
this.BackingFile = fInfo;
}
public override Stream OpenRead()
{
return BackingFile.OpenRead();
}
}
}