1616using Microsoft . Owin . FileSystems ;
1717using IOwinFileSystem = Microsoft . Owin . FileSystems . IFileSystem ;
1818#else
19- using Microsoft . AspNet . FileSystems ;
19+ using Microsoft . AspNet . FileProviders ;
2020using Microsoft . Framework . Expiration . Interfaces ;
21- using IOwinFileSystem = Microsoft . AspNet . FileSystems . IFileSystem ;
21+ using IOwinFileSystem = Microsoft . AspNet . FileProviders . IFileProvider ;
22+ using PhysicalFileSystem = Microsoft . AspNet . FileProviders . PhysicalFileProvider ;
2223#endif
2324
2425#if OWIN
@@ -126,6 +127,20 @@ public IDirectoryContents GetDirectoryContents(string subpath)
126127 {
127128 return _physicalFileSystem . GetDirectoryContents ( subpath ) ;
128129 }
130+
131+ /// <summary>
132+ /// Creates a change trigger with the specified filter.
133+ /// </summary>
134+ /// <param name="filter">
135+ /// Filter string used to determine what files or folders to monitor. Example: **/*.cs, *.*, subFolder/**/*.cshtml.
136+ /// </param>
137+ /// <returns>
138+ /// An <see cref="IExpirationTrigger"/> that is triggered when a file matching <paramref name="filter"/> is added, modified or deleted.
139+ /// </returns>
140+ public IExpirationTrigger Watch ( string filter )
141+ {
142+ return _physicalFileSystem . Watch ( filter ) ;
143+ }
129144#endif
130145
131146 private class JsxFileInfo : IFileInfo
@@ -164,17 +179,22 @@ public string Name
164179 get { return _fileInfo . Name ; }
165180 }
166181
182+ public bool IsDirectory
183+ {
184+ get { return _fileInfo . IsDirectory ; }
185+ }
186+
187+ #if OWIN
167188 public DateTime LastModified
168189 {
169190 get { return _fileInfo . LastModified ; }
170191 }
171-
172- public bool IsDirectory
192+ #else
193+ public DateTimeOffset LastModified
173194 {
174- get { return _fileInfo . IsDirectory ; }
195+ get { return _fileInfo . LastModified ; }
175196 }
176197
177- #if ! OWIN
178198 public void WriteContent ( byte [ ] content )
179199 {
180200 _fileInfo . WriteContent ( content ) ;
@@ -185,11 +205,6 @@ public void Delete()
185205 _fileInfo . Delete ( ) ;
186206 }
187207
188- public IExpirationTrigger CreateFileChangeTrigger ( )
189- {
190- return _fileInfo . CreateFileChangeTrigger ( ) ;
191- }
192-
193208 public bool Exists
194209 {
195210 get { return _fileInfo . Exists ; }
0 commit comments