Merge pull request #1337 from RyanMelenaNoesis/master
[mono.git] / mcs / class / System.Web.Abstractions / System.Web / HttpResponseWrapper.cs
1 //
2 // HttpResponseWrapper.cs
3 //
4 // Author:
5 //      Atsushi Enomoto <atsushi@ximian.com>
6 //
7 // Copyright (C) 2008 Novell Inc. http://novell.com
8 //
9
10 //
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:
18 // 
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
21 // 
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.
29 //
30 using System;
31 using System.Collections;
32 using System.Collections.Generic;
33 using System.Collections.Specialized;
34 using System.Globalization;
35 using System.IO;
36 using System.Runtime.CompilerServices;
37 using System.Runtime.Serialization;
38 using System.Security.Permissions;
39 using System.Security.Principal;
40 using System.Text;
41 using System.Web.Caching;
42
43 namespace System.Web
44 {
45 #if NET_4_0
46         [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
47 #endif
48         [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
49         [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
50         public class HttpResponseWrapper : HttpResponseBase
51         {
52                 HttpResponse w;
53
54                 public HttpResponseWrapper (HttpResponse httpResponse)
55                 {
56                         if (httpResponse == null)
57                                 throw new ArgumentNullException ("httpResponse");
58                         w = httpResponse;
59                 }
60
61                 public override bool Buffer {
62                         get { return w.Buffer; }
63                         set { w.Buffer = value; }
64                 }
65
66                 public override bool BufferOutput {
67                         get { return w.BufferOutput; }
68                         set { w.BufferOutput = value; }
69                 }
70
71                 public override HttpCachePolicyBase Cache {
72                         get { return new HttpCachePolicyWrapper (w.Cache); }
73                 }
74
75                 public override string CacheControl {
76                         get { return w.CacheControl; }
77                         set { w.CacheControl = value; }
78                 }
79
80                 public override string Charset {
81                         get { return w.Charset; }
82                         set { w.Charset = value; }
83                 }
84
85                 public override Encoding ContentEncoding {
86                         get { return w.ContentEncoding; }
87                         set { w.ContentEncoding = value; }
88                 }
89
90                 public override string ContentType {
91                         get { return w.ContentType; }
92                         set { w.ContentType = value; }
93                 }
94
95                 public override HttpCookieCollection Cookies {
96                         get { return w.Cookies; }
97                 }
98
99                 public override int Expires {
100                         get { return w.Expires; }
101                         set { w.Expires = value; }
102                 }
103
104                 public override DateTime ExpiresAbsolute {
105                         get { return w.ExpiresAbsolute; }
106                         set { w.ExpiresAbsolute = value; }
107                 }
108
109                 public override Stream Filter {
110                         get { return w.Filter; }
111                         set { w.Filter = value; }
112                 }
113
114                 public override Encoding HeaderEncoding {
115                         get { return w.HeaderEncoding; }
116                         set { w.HeaderEncoding = value; }
117                 }
118
119                 public override NameValueCollection Headers {
120                         get { return w.Headers; }
121                 }
122
123                 public override bool IsClientConnected {
124                         get { return w.IsClientConnected; }
125                 }
126
127                 public override bool IsRequestBeingRedirected {
128                         get { return w.IsRequestBeingRedirected; }
129                 }
130
131                 public override TextWriter Output {
132                         get { return w.Output; }
133 #if NET_4_0
134                         set { w.Output = value; }
135 #endif
136                 }
137
138                 public override Stream OutputStream {
139                         get { return w.OutputStream; }
140                 }
141
142                 public override string RedirectLocation {
143                         get { return w.RedirectLocation; }
144                         set { w.RedirectLocation = value; }
145                 }
146
147                 public override string Status {
148                         get { return w.Status; }
149                         set { w.Status = value; }
150                 }
151
152                 public override int StatusCode {
153                         get { return w.StatusCode; }
154                         set { w.StatusCode = value; }
155                 }
156
157                 public override string StatusDescription {
158                         get { return w.StatusDescription; }
159                         set { w.StatusDescription = value; }
160                 }
161
162                 public override int SubStatusCode {
163                         get { return w.SubStatusCode; }
164                         set { w.SubStatusCode = value; }
165                 }
166
167                 public override bool SuppressContent {
168                         get { return w.SuppressContent; }
169                         set { w.SuppressContent = value; }
170                 }
171
172 #if NET_4_5
173                 public override bool SuppressFormsAuthenticationRedirect {
174                         get { return w.SuppressFormsAuthenticationRedirect; }
175                         set { w.SuppressFormsAuthenticationRedirect = value; }
176                 }
177 #endif
178
179                 public override bool TrySkipIisCustomErrors {
180                         get { return w.TrySkipIisCustomErrors; }
181                         set { w.TrySkipIisCustomErrors = value; }
182                 }
183
184                 public override void AddCacheDependency (params CacheDependency [] dependencies)
185                 {
186                         w.AddCacheDependency (dependencies);
187                 }
188
189                 public override void AddCacheItemDependencies (ArrayList cacheKeys)
190                 {
191                         w.AddCacheItemDependencies (cacheKeys);
192                 }
193
194                 public override void AddCacheItemDependencies (string [] cacheKeys)
195                 {
196                         w.AddCacheItemDependencies (cacheKeys);
197                 }
198
199                 public override void AddCacheItemDependency (string cacheKey)
200                 {
201                         w.AddCacheItemDependency (cacheKey);
202                 }
203
204                 public override void AddFileDependencies (ArrayList filenames)
205                 {
206                         w.AddFileDependencies (filenames);
207                 }
208
209                 public override void AddFileDependencies (string [] filenames)
210                 {
211                         w.AddFileDependencies (filenames);
212                 }
213
214                 public override void AddFileDependency (string filename)
215                 {
216                         w.AddFileDependency (filename);
217                 }
218
219                 public override void AddHeader (string name, string value)
220                 {
221                         w.AddHeader (name, value);
222                 }
223
224                 public override void AppendCookie (HttpCookie cookie)
225                 {
226                         w.AppendCookie (cookie);
227                 }
228
229                 public override void AppendHeader (string name, string value)
230                 {
231                         w.AppendHeader (name, value);
232                 }
233
234                 public override void AppendToLog (string param)
235                 {
236                         w.AppendToLog (param);
237                 }
238
239                 public override string ApplyAppPathModifier (string overridePath)
240                 {
241                         return w.ApplyAppPathModifier (overridePath);
242                 }
243
244                 public override void BinaryWrite (byte [] buffer)
245                 {
246                         w.BinaryWrite (buffer);
247                 }
248
249                 public override void Clear ()
250                 {
251                         w.Clear ();
252                 }
253
254                 public override void ClearContent ()
255                 {
256                         w.ClearContent ();
257                 }
258
259                 public override void ClearHeaders ()
260                 {
261                         w.ClearHeaders ();
262                 }
263
264                 public override void Close ()
265                 {
266                         w.Close ();
267                 }
268
269                 public override void DisableKernelCache ()
270                 {
271                          w.DisableKernelCache ();
272                 }
273
274                 public override void End ()
275                 {
276                         w.End ();
277                 }
278
279                 public override void Flush ()
280                 {
281                         w.Flush ();
282                 }
283
284                 public override void Pics (string value)
285                 {
286                         w.Pics (value);
287                 }
288
289                 public override void Redirect (string url)
290                 {
291                         w.Redirect (url);
292                 }
293
294                 public override void Redirect (string url, bool endResponse)
295                 {
296                         w.Redirect (url, endResponse);
297                 }
298 #if NET_4_0
299                 public override void RedirectPermanent (string url)
300                 {
301                         w.RedirectPermanent (url);
302                 }
303
304                 public override void RedirectPermanent (string url, bool endResponse)
305                 {
306                         w.RedirectPermanent (url, endResponse);
307                 }
308
309                 public override void RemoveOutputCacheItem (string path, string providerName)
310                 {
311                         HttpResponse.RemoveOutputCacheItem (path, providerName);
312                 }
313 #endif
314                 public override void RemoveOutputCacheItem (string path)
315                 {
316                          HttpResponse.RemoveOutputCacheItem (path);
317                 }
318
319                 public override void SetCookie (HttpCookie cookie)
320                 {
321                         w.SetCookie (cookie);
322                 }
323
324                 public override void TransmitFile (string filename)
325                 {
326                         w.TransmitFile (filename);
327                 }
328
329                 public override void TransmitFile (string filename, long offset, long length)
330                 {
331                         w.TransmitFile (filename, offset, length);
332                 }
333
334                 public override void Write (char ch)
335                 {
336                         w.Write (ch);
337                 }
338
339                 public override void Write (object obj)
340                 {
341                         w.Write (obj);
342                 }
343
344                 public override void Write (string s)
345                 {
346                         w.Write (s);
347                 }
348
349                 public override void Write (char [] buffer, int index, int count)
350                 {
351                         w.Write (buffer, index, count);
352                 }
353
354                 public override void WriteFile (string filename)
355                 {
356                         w.WriteFile (filename);
357                 }
358
359                 public override void WriteFile (string filename, bool readIntoMemory)
360                 {
361                         w.WriteFile (filename, readIntoMemory);
362                 }
363
364                 public override void WriteFile (IntPtr fileHandle, long offset, long size)
365                 {
366                         w.WriteFile (fileHandle, offset, size);
367                 }
368
369                 public override void WriteFile (string filename, long offset, long size)
370                 {
371                         w.WriteFile (filename, offset, size);
372                 }
373
374                 public override void WriteSubstitution (HttpResponseSubstitutionCallback callback)
375                 {
376                         w.WriteSubstitution (callback);
377                 }
378         }
379 }