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