2009-06-12 Bill Holmes <billholmes54@gmail.com>
[mono.git] / mcs / class / System.Web.Abstractions / System.Web / HttpRequestWrapper.cs
1 //
2 // HttpRequestWrapper.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.Serialization;
37 using System.Security.Permissions;
38 using System.Security.Principal;
39 using System.Text;
40 using System.Web.Caching;
41
42 namespace System.Web
43 {
44         [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
45         [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
46         public class HttpRequestWrapper : HttpRequestBase
47         {
48                 HttpRequest w;
49
50                 public HttpRequestWrapper (HttpRequest httpRequest)
51                 {
52                         if (httpRequest == null)
53                                 throw new ArgumentNullException ("httpRequest");
54                         w = httpRequest;
55                 }
56
57                 public override string [] AcceptTypes {
58                         get { return w.AcceptTypes; }
59                 }
60
61                 public override string AnonymousID {
62                         get { return w.AnonymousID; }
63                 }
64
65                 public override string ApplicationPath {
66                         get { return w.ApplicationPath; }
67                 }
68
69                 public override string AppRelativeCurrentExecutionFilePath {
70                         get { return w.AppRelativeCurrentExecutionFilePath; }
71                 }
72
73                 public override HttpBrowserCapabilitiesBase Browser {
74                         get { return new HttpBrowserCapabilitiesWrapper (w.Browser); }
75                 }
76
77                 public override HttpClientCertificate ClientCertificate {
78                         get { return w.ClientCertificate; }
79                 }
80
81                 public override Encoding ContentEncoding {
82                         get { return w.ContentEncoding; }
83                         set { w.ContentEncoding = value; }
84                 }
85
86                 public override int ContentLength {
87                         get { return w.ContentLength; }
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 string CurrentExecutionFilePath {
100                         get { return w.CurrentExecutionFilePath; }
101                 }
102
103                 public override string FilePath {
104                         get { return w.FilePath; }
105                 }
106
107                 public override HttpFileCollectionBase Files {
108                         get { return new HttpFileCollectionWrapper (w.Files); }
109                 }
110
111                 public override Stream Filter {
112                         get { return w.Filter; }
113                         set { w.Filter = value; }
114                 }
115
116                 public override NameValueCollection Form {
117                         get { return w.Form; }
118                 }
119
120                 public override NameValueCollection Headers {
121                         get { return w.Headers; }
122                 }
123
124                 public override string HttpMethod {
125                         get { return w.HttpMethod; }
126                 }
127
128                 public override Stream InputStream {
129                         get { return w.InputStream; }
130                 }
131
132                 public override bool IsAuthenticated {
133                         get { return w.IsAuthenticated; }
134                 }
135
136                 public override bool IsLocal {
137                         get { return w.IsLocal; }
138                 }
139
140                 public override bool IsSecureConnection {
141                         get { return w.IsSecureConnection; }
142                 }
143
144                 public override string this [string key] {
145                         get { return w [key]; }
146                 }
147
148                 public override WindowsIdentity LogonUserIdentity {
149                         get { return w.LogonUserIdentity; }
150                 }
151
152                 public override NameValueCollection Params {
153                         get { return w.Params; }
154                 }
155
156                 public override string Path {
157                         get { return w.Path; }
158                 }
159
160                 public override string PathInfo {
161                         get { return w.PathInfo; }
162                 }
163
164                 public override string PhysicalApplicationPath {
165                         get { return w.PhysicalApplicationPath; }
166                 }
167
168                 public override string PhysicalPath {
169                         get { return w.PhysicalPath; }
170                 }
171
172                 public override NameValueCollection QueryString {
173                         get { return w.QueryString; }
174                 }
175
176                 public override string RawUrl {
177                         get { return w.RawUrl; }
178                 }
179
180                 public override string RequestType {
181                         get { return w.RequestType; }
182                         set { w.RequestType = value; }
183                 }
184
185                 public override NameValueCollection ServerVariables {
186                         get { return w.ServerVariables; }
187                 }
188
189                 public override int TotalBytes {
190                         get { return w.TotalBytes; }
191                 }
192
193                 public override Uri Url {
194                         get { return w.Url; }
195                 }
196
197                 public override Uri UrlReferrer {
198                         get { return w.UrlReferrer; }
199                 }
200
201                 public override string UserAgent {
202                         get { return w.UserAgent; }
203                 }
204
205                 public override string UserHostAddress {
206                         get { return w.UserHostAddress; }
207                 }
208
209                 public override string UserHostName {
210                         get { return w.UserHostName; }
211                 }
212
213                 public override string [] UserLanguages {
214                         get { return w.UserLanguages; }
215                 }
216
217                 public override byte [] BinaryRead (int count)
218                 {
219                         return w.BinaryRead (count);
220                 }
221
222                 public override int [] MapImageCoordinates (string imageFieldName)
223                 {
224                         return w.MapImageCoordinates (imageFieldName);
225                 }
226
227                 public override string MapPath (string overridePath)
228                 {
229                         return w.MapPath (overridePath);
230                 }
231
232                 public override string MapPath (string overridePath, string baseVirtualDir, bool allowCrossAppMapping)
233                 {
234                         return w.MapPath (overridePath, baseVirtualDir, allowCrossAppMapping);
235                 }
236
237                 public override void SaveAs (string filename, bool includeHeaders)
238                 {
239                         w.SaveAs (filename, includeHeaders);
240                 }
241
242                 public override void ValidateInput ()
243                 {
244                         w.ValidateInput ();
245                 }
246         }
247 }