2008-02-18 Marek Habersack <mhabersack@novell.com>
authorMarek Habersack <grendel@twistedcode.net>
Mon, 18 Feb 2008 17:01:53 +0000 (17:01 -0000)
committerMarek Habersack <grendel@twistedcode.net>
Mon, 18 Feb 2008 17:01:53 +0000 (17:01 -0000)
* VirtualPathProvider.cs: chain up to the previous provider, if
prexent. Fixes bug #362038

svn path=/trunk/mcs/; revision=96079

mcs/class/System.Web/System.Web.Hosting/ChangeLog
mcs/class/System.Web/System.Web.Hosting/VirtualPathProvider.cs

index 1d26ee2e9141d870670ec5f14ca84fd9f132b880..c7b737477a8d53994cf4956517f96a964a8b64bc 100644 (file)
@@ -1,3 +1,8 @@
+2008-02-18  Marek Habersack  <mhabersack@novell.com>
+
+       * VirtualPathProvider.cs: chain up to the previous provider, if
+       prexent. Fixes bug #362038
+
 2008-01-06  Marek Habersack  <mhabersack@novell.com>
 
        * ApplicationHost.cs: make sure that application with virtualDir
index 05d793544cb420c0c7f2b10f9671797b2ce9ff6b..69672822a6259f4ad0a95ceaca922e969fe2f841 100644 (file)
@@ -63,38 +63,57 @@ namespace System.Web.Hosting {
 
                public virtual bool DirectoryExists (string virtualDir)
                {
+                       if (prev != null)
+                               return prev.DirectoryExists (virtualDir);
+                       
                        return false;
                }
 
                public virtual bool FileExists (string virtualPath)
                {
+                       if (prev != null)
+                               return FileExists (virtualPath);
+                       
                        return false;
                }
 
-               public virtual CacheDependency GetCacheDependency (string virtualPath,
-                                                               IEnumerable virtualPathDependencies,
-                                                               DateTime utcStart)
+               public virtual CacheDependency GetCacheDependency (string virtualPath, IEnumerable virtualPathDependencies, DateTime utcStart)
                {
+                       if (prev != null)
+                               return prev.GetCacheDependency (virtualPath, virtualPathDependencies, utcStart);
+                       
                        return null;
                }
 
                public virtual string GetCacheKey (string virtualPath)
                {
+                       if (prev != null)
+                               return prev.GetCacheKey (virtualPath);
+                       
                        return null;
                }
 
                public virtual VirtualDirectory GetDirectory (string virtualDir)
                {
+                       if (prev != null)
+                               return prev.GetDirectory (virtualDir);
+                       
                        return null;
                }
 
                public virtual VirtualFile GetFile (string virtualPath)
                {
+                       if (prev != null)
+                               return prev.GetFile (virtualPath);
+                       
                        return null;
                }
 
                public virtual string GetFileHash (string virtualPath, IEnumerable virtualPathDependencies)
                {
+                       if (prev != null)
+                               return prev.GetFileHash (virtualPath, virtualPathDependencies);
+                       
                        return null;
                }
 
@@ -108,7 +127,10 @@ namespace System.Web.Hosting {
                        // This thing throws a nullref when we're not inside an ASP.NET appdomain, which is what MS does.
                        VirtualPathProvider provider = HostingEnvironment.VirtualPathProvider;
                        VirtualFile file = provider.GetFile (virtualPath);
-                       return file.Open ();
+                       if (file != null)
+                               return file.Open ();
+
+                       return null;
                }
        }
 }