2 // HttpResponseWrapper.cs
5 // Atsushi Enomoto <atsushi@ximian.com>
7 // Copyright (C) 2008 Novell Inc. http://novell.com
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 using System.Collections;
32 using System.Collections.Generic;
33 using System.Collections.Specialized;
34 using System.Globalization;
36 using System.Runtime.CompilerServices;
37 using System.Runtime.Serialization;
38 using System.Security.Permissions;
39 using System.Security.Principal;
41 using System.Web.Caching;
46 [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
48 [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
49 [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
50 public class HttpResponseWrapper : HttpResponseBase
54 public HttpResponseWrapper (HttpResponse httpResponse)
56 if (httpResponse == null)
57 throw new ArgumentNullException ("httpResponse");
61 public override bool Buffer {
62 get { return w.Buffer; }
63 set { w.Buffer = value; }
66 public override bool BufferOutput {
67 get { return w.BufferOutput; }
68 set { w.BufferOutput = value; }
71 public override HttpCachePolicyBase Cache {
72 get { return new HttpCachePolicyWrapper (w.Cache); }
75 public override string CacheControl {
76 get { return w.CacheControl; }
77 set { w.CacheControl = value; }
80 public override string Charset {
81 get { return w.Charset; }
82 set { w.Charset = value; }
85 public override Encoding ContentEncoding {
86 get { return w.ContentEncoding; }
87 set { w.ContentEncoding = value; }
90 public override string ContentType {
91 get { return w.ContentType; }
92 set { w.ContentType = value; }
95 public override HttpCookieCollection Cookies {
96 get { return w.Cookies; }
99 public override int Expires {
100 get { return w.Expires; }
101 set { w.Expires = value; }
104 public override DateTime ExpiresAbsolute {
105 get { return w.ExpiresAbsolute; }
106 set { w.ExpiresAbsolute = value; }
109 public override Stream Filter {
110 get { return w.Filter; }
111 set { w.Filter = value; }
114 public override Encoding HeaderEncoding {
115 get { return w.HeaderEncoding; }
116 set { w.HeaderEncoding = value; }
119 public override NameValueCollection Headers {
120 get { return w.Headers; }
123 public override bool IsClientConnected {
124 get { return w.IsClientConnected; }
127 public override bool IsRequestBeingRedirected {
128 get { return w.IsRequestBeingRedirected; }
131 public override TextWriter Output {
132 get { return w.Output; }
134 set { w.Output = value; }
138 public override Stream OutputStream {
139 get { return w.OutputStream; }
142 public override string RedirectLocation {
143 get { return w.RedirectLocation; }
144 set { w.RedirectLocation = value; }
147 public override string Status {
148 get { return w.Status; }
149 set { w.Status = value; }
152 public override int StatusCode {
153 get { return w.StatusCode; }
154 set { w.StatusCode = value; }
157 public override string StatusDescription {
158 get { return w.StatusDescription; }
159 set { w.StatusDescription = value; }
162 public override int SubStatusCode {
163 get { return w.SubStatusCode; }
164 set { w.SubStatusCode = value; }
167 public override bool SuppressContent {
168 get { return w.SuppressContent; }
169 set { w.SuppressContent = value; }
173 public override bool SuppressFormsAuthenticationRedirect {
174 get { return w.SuppressFormsAuthenticationRedirect; }
175 set { w.SuppressFormsAuthenticationRedirect = value; }
179 public override bool TrySkipIisCustomErrors {
180 get { return w.TrySkipIisCustomErrors; }
181 set { w.TrySkipIisCustomErrors = value; }
184 public override void AddCacheDependency (params CacheDependency [] dependencies)
186 w.AddCacheDependency (dependencies);
189 public override void AddCacheItemDependencies (ArrayList cacheKeys)
191 w.AddCacheItemDependencies (cacheKeys);
194 public override void AddCacheItemDependencies (string [] cacheKeys)
196 w.AddCacheItemDependencies (cacheKeys);
199 public override void AddCacheItemDependency (string cacheKey)
201 w.AddCacheItemDependency (cacheKey);
204 public override void AddFileDependencies (ArrayList filenames)
206 w.AddFileDependencies (filenames);
209 public override void AddFileDependencies (string [] filenames)
211 w.AddFileDependencies (filenames);
214 public override void AddFileDependency (string filename)
216 w.AddFileDependency (filename);
219 public override void AddHeader (string name, string value)
221 w.AddHeader (name, value);
224 public override void AppendCookie (HttpCookie cookie)
226 w.AppendCookie (cookie);
229 public override void AppendHeader (string name, string value)
231 w.AppendHeader (name, value);
234 public override void AppendToLog (string param)
236 w.AppendToLog (param);
239 public override string ApplyAppPathModifier (string overridePath)
241 return w.ApplyAppPathModifier (overridePath);
244 public override void BinaryWrite (byte [] buffer)
246 w.BinaryWrite (buffer);
249 public override void Clear ()
254 public override void ClearContent ()
259 public override void ClearHeaders ()
264 public override void Close ()
269 public override void DisableKernelCache ()
271 w.DisableKernelCache ();
274 public override void End ()
279 public override void Flush ()
284 public override void Pics (string value)
289 public override void Redirect (string url)
294 public override void Redirect (string url, bool endResponse)
296 w.Redirect (url, endResponse);
299 public override void RedirectPermanent (string url)
301 w.RedirectPermanent (url);
304 public override void RedirectPermanent (string url, bool endResponse)
306 w.RedirectPermanent (url, endResponse);
309 public override void RemoveOutputCacheItem (string path, string providerName)
311 HttpResponse.RemoveOutputCacheItem (path, providerName);
314 public override void RemoveOutputCacheItem (string path)
316 HttpResponse.RemoveOutputCacheItem (path);
319 public override void SetCookie (HttpCookie cookie)
321 w.SetCookie (cookie);
324 public override void TransmitFile (string filename)
326 w.TransmitFile (filename);
329 public override void TransmitFile (string filename, long offset, long length)
331 w.TransmitFile (filename, offset, length);
334 public override void Write (char ch)
339 public override void Write (object obj)
344 public override void Write (string s)
349 public override void Write (char [] buffer, int index, int count)
351 w.Write (buffer, index, count);
354 public override void WriteFile (string filename)
356 w.WriteFile (filename);
359 public override void WriteFile (string filename, bool readIntoMemory)
361 w.WriteFile (filename, readIntoMemory);
364 public override void WriteFile (IntPtr fileHandle, long offset, long size)
366 w.WriteFile (fileHandle, offset, size);
369 public override void WriteFile (string filename, long offset, long size)
371 w.WriteFile (filename, offset, size);
374 public override void WriteSubstitution (HttpResponseSubstitutionCallback callback)
376 w.WriteSubstitution (callback);