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; }
172 public override bool TrySkipIisCustomErrors {
173 get { return w.TrySkipIisCustomErrors; }
174 set { w.TrySkipIisCustomErrors = value; }
177 public override void AddCacheDependency (params CacheDependency [] dependencies)
179 w.AddCacheDependency (dependencies);
182 public override void AddCacheItemDependencies (ArrayList cacheKeys)
184 w.AddCacheItemDependencies (cacheKeys);
187 public override void AddCacheItemDependencies (string [] cacheKeys)
189 w.AddCacheItemDependencies (cacheKeys);
192 public override void AddCacheItemDependency (string cacheKey)
194 w.AddCacheItemDependency (cacheKey);
197 public override void AddFileDependencies (ArrayList filenames)
199 w.AddFileDependencies (filenames);
202 public override void AddFileDependencies (string [] filenames)
204 w.AddFileDependencies (filenames);
207 public override void AddFileDependency (string filename)
209 w.AddFileDependency (filename);
212 public override void AddHeader (string name, string value)
214 w.AddHeader (name, value);
217 public override void AppendCookie (HttpCookie cookie)
219 w.AppendCookie (cookie);
222 public override void AppendHeader (string name, string value)
224 w.AppendHeader (name, value);
227 public override void AppendToLog (string param)
229 w.AppendToLog (param);
232 public override string ApplyAppPathModifier (string overridePath)
234 return w.ApplyAppPathModifier (overridePath);
237 public override void BinaryWrite (byte [] buffer)
239 w.BinaryWrite (buffer);
242 public override void Clear ()
247 public override void ClearContent ()
252 public override void ClearHeaders ()
257 public override void Close ()
262 public override void DisableKernelCache ()
264 w.DisableKernelCache ();
267 public override void End ()
272 public override void Flush ()
277 public override void Pics (string value)
282 public override void Redirect (string url)
287 public override void Redirect (string url, bool endResponse)
289 w.Redirect (url, endResponse);
292 public override void RedirectPermanent (string url)
294 w.RedirectPermanent (url);
297 public override void RedirectPermanent (string url, bool endResponse)
299 w.RedirectPermanent (url, endResponse);
302 public override void RemoveOutputCacheItem (string path, string providerName)
304 HttpResponse.RemoveOutputCacheItem (path, providerName);
307 public override void RemoveOutputCacheItem (string path)
309 HttpResponse.RemoveOutputCacheItem (path);
312 public override void SetCookie (HttpCookie cookie)
314 w.SetCookie (cookie);
317 public override void TransmitFile (string filename)
319 w.TransmitFile (filename);
322 public override void TransmitFile (string filename, long offset, long length)
324 w.TransmitFile (filename, offset, length);
327 public override void Write (char ch)
332 public override void Write (object obj)
337 public override void Write (string s)
342 public override void Write (char [] buffer, int index, int count)
344 w.Write (buffer, index, count);
347 public override void WriteFile (string filename)
349 w.WriteFile (filename);
352 public override void WriteFile (string filename, bool readIntoMemory)
354 w.WriteFile (filename, readIntoMemory);
357 public override void WriteFile (IntPtr fileHandle, long offset, long size)
359 w.WriteFile (fileHandle, offset, size);
362 public override void WriteFile (string filename, long offset, long size)
364 w.WriteFile (filename, offset, size);
367 public override void WriteSubstitution (HttpResponseSubstitutionCallback callback)
369 w.WriteSubstitution (callback);