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