HttpServerUtilityWrapper.cs 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. //
  2. // HttpServerUtilityWrapper.cs
  3. //
  4. // Author:
  5. // Atsushi Enomoto <[email protected]>
  6. //
  7. // Copyright (C) 2008 Novell Inc. http://novell.com
  8. //
  9. //
  10. // Permission is hereby granted, free of charge, to any person obtaining
  11. // a copy of this software and associated documentation files (the
  12. // "Software"), to deal in the Software without restriction, including
  13. // without limitation the rights to use, copy, modify, merge, publish,
  14. // distribute, sublicense, and/or sell copies of the Software, and to
  15. // permit persons to whom the Software is furnished to do so, subject to
  16. // the following conditions:
  17. //
  18. // The above copyright notice and this permission notice shall be
  19. // included in all copies or substantial portions of the Software.
  20. //
  21. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  22. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  23. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  24. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  25. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  26. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  27. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  28. //
  29. using System;
  30. using System.Collections;
  31. using System.Collections.Generic;
  32. using System.Collections.Specialized;
  33. using System.Globalization;
  34. using System.IO;
  35. using System.Runtime.CompilerServices;
  36. using System.Security.Permissions;
  37. using System.Security.Principal;
  38. using System.Web.Caching;
  39. using System.Web.Profile;
  40. namespace System.Web
  41. {
  42. #if NET_4_0
  43. [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
  44. #endif
  45. [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
  46. [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
  47. public class HttpServerUtilityWrapper : HttpServerUtilityBase
  48. {
  49. HttpServerUtility w;
  50. public HttpServerUtilityWrapper (HttpServerUtility httpServerUtility)
  51. {
  52. if (httpServerUtility == null)
  53. throw new ArgumentNullException ("httpServerUtility");
  54. w = httpServerUtility;
  55. }
  56. public override string MachineName {
  57. get { return w.MachineName; }
  58. }
  59. public override int ScriptTimeout {
  60. get { return w.ScriptTimeout; }
  61. set { w.ScriptTimeout = value; }
  62. }
  63. public override void ClearError ()
  64. {
  65. w.ClearError ();
  66. }
  67. public override object CreateObject (string progID)
  68. {
  69. return w.CreateObject (progID);
  70. }
  71. public override object CreateObject (Type type)
  72. {
  73. return w.CreateObject (type);
  74. }
  75. public override object CreateObjectFromClsid (string clsid)
  76. {
  77. return w.CreateObjectFromClsid (clsid);
  78. }
  79. public override void Execute (string path)
  80. {
  81. w.Execute (path);
  82. }
  83. public override void Execute (string path, bool preserveForm)
  84. {
  85. w.Execute (path, preserveForm);
  86. }
  87. public override void Execute (string path, TextWriter writer)
  88. {
  89. w.Execute (path, writer);
  90. }
  91. public override void Execute (string path, TextWriter writer, bool preserveForm)
  92. {
  93. w.Execute (path, writer, preserveForm);
  94. }
  95. public override void Execute (IHttpHandler handler, TextWriter writer, bool preserveForm)
  96. {
  97. w.Execute (handler, writer, preserveForm);
  98. }
  99. public override Exception GetLastError ()
  100. {
  101. return w.GetLastError ();
  102. }
  103. public override string HtmlDecode (string s)
  104. {
  105. return w.HtmlDecode (s);
  106. }
  107. public override void HtmlDecode (string s, TextWriter output)
  108. {
  109. w.HtmlDecode (s, output);
  110. }
  111. public override string HtmlEncode (string s)
  112. {
  113. return w.HtmlEncode (s);
  114. }
  115. public override void HtmlEncode (string s, TextWriter output)
  116. {
  117. w.HtmlEncode (s, output);
  118. }
  119. public override string MapPath (string path)
  120. {
  121. return w.MapPath (path);
  122. }
  123. public override void Transfer (string path)
  124. {
  125. w.Transfer (path);
  126. }
  127. public override void Transfer (string path, bool preserveForm)
  128. {
  129. w.Transfer (path, preserveForm);
  130. }
  131. public override void Transfer (IHttpHandler handler, bool preserveForm)
  132. {
  133. w.Transfer (handler, preserveForm);
  134. }
  135. [MonoTODO]
  136. public override void TransferRequest (string path)
  137. {
  138. // return TransferRequest (path);
  139. throw new NotImplementedException ();
  140. }
  141. [MonoTODO]
  142. public override void TransferRequest (string path, bool preserveForm)
  143. {
  144. // return TransferRequest (path, preserveForm);
  145. throw new NotImplementedException ();
  146. }
  147. [MonoTODO]
  148. public override void TransferRequest (string path, bool preserveForm, string method, NameValueCollection headers)
  149. {
  150. // return TransferRequest (path, preserveForm, method, headers);
  151. throw new NotImplementedException ();
  152. }
  153. public override string UrlDecode (string s)
  154. {
  155. return w.UrlDecode (s);
  156. }
  157. public override void UrlDecode (string s, TextWriter output)
  158. {
  159. w.UrlDecode (s, output);
  160. }
  161. public override string UrlEncode (string s)
  162. {
  163. return w.UrlEncode (s);
  164. }
  165. public override void UrlEncode (string s, TextWriter output)
  166. {
  167. w.UrlEncode (s, output);
  168. }
  169. public override string UrlPathEncode (string s)
  170. {
  171. return w.UrlPathEncode (s);
  172. }
  173. [MonoTODO]
  174. public override byte [] UrlTokenDecode (string input)
  175. {
  176. // return w.UrlTokenDecode (input);
  177. throw new NotImplementedException ();
  178. }
  179. [MonoTODO]
  180. public override string UrlTokenEncode (byte [] input)
  181. {
  182. // return w.UrlTokenEncode (input);
  183. throw new NotImplementedException ();
  184. }
  185. }
  186. }