using System.IO;\r
\r
namespace System.Web {\r
- /// <summary>\r
- /// System.Web.\r
- /// </summary>\r
public sealed class HttpServerUtility {\r
\r
private static string _name = "";\r
\r
private HttpContext _Context;\r
+ private HttpApplication _Application;\r
\r
[MonoTODO()]\r
- public HttpServerUtility(HttpContext Context) {\r
+ internal HttpServerUtility(HttpContext Context) {\r
_Context = Context;\r
}\r
\r
+ [MonoTODO()]\r
+ internal HttpServerUtility(HttpApplication app) {\r
+ _Application = app;\r
+ }\r
+\r
// Properties\r
\r
\r
/// Clears the previous exception.\r
/// </summary>\r
public void ClearError() {\r
- _Context.ClearError();\r
+ if (null != _Context) {\r
+ _Context.ClearError();\r
+ return;\r
+ }\r
+\r
+ if (null != _Application) {\r
+ _Application.ClearError();\r
+ }\r
}\r
\r
\r
/// <param name="path">The virtual path on the Web server. </param>\r
/// <returns>The physical file path that corresponds to path.</returns>\r
public string MapPath(string path) {\r
+ if (null == _Context) {\r
+ throw new HttpException("MapPath is not available");\r
+ }\r
+\r
return _Context.Request.MapPath(path);\r
}\r
\r