Handle changes in FileProviders.

This commit is contained in:
Chris Ross 2015-04-23 12:18:49 -07:00
parent 925d7d7828
commit 6ae3d90ad0
1 changed files with 58 additions and 2 deletions

View File

@ -66,7 +66,7 @@ namespace Microsoft.AspNet.StaticFiles
public IDirectoryContents GetDirectoryContents(string subpath) public IDirectoryContents GetDirectoryContents(string subpath)
{ {
return new NotFoundDirectoryContents(); throw new NotImplementedException();
} }
public IFileInfo GetFileInfo(string subpath) public IFileInfo GetFileInfo(string subpath)
@ -77,13 +77,69 @@ namespace Microsoft.AspNet.StaticFiles
return result; return result;
} }
return new NotFoundFileInfo(subpath); return new NotFoundFileInfo();
} }
public IExpirationTrigger Watch(string filter) public IExpirationTrigger Watch(string filter)
{ {
throw new NotSupportedException(); throw new NotSupportedException();
} }
private class NotFoundFileInfo : IFileInfo
{
public bool Exists
{
get
{
return false;
}
}
public bool IsDirectory
{
get
{
throw new NotImplementedException();
}
}
public DateTimeOffset LastModified
{
get
{
throw new NotImplementedException();
}
}
public long Length
{
get
{
throw new NotImplementedException();
}
}
public string Name
{
get
{
throw new NotImplementedException();
}
}
public string PhysicalPath
{
get
{
throw new NotImplementedException();
}
}
public Stream CreateReadStream()
{
throw new NotImplementedException();
}
}
} }
private sealed class TestFileInfo : IFileInfo private sealed class TestFileInfo : IFileInfo