Skip to main content
summaryrefslogtreecommitdiffstats
blob: f5870bb995f86035d2fd351e3c56a18ebe4c025b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
/*******************************************************************************
 * Copyright (c) 1999, 2005 IBM Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.equinox.http.servlet;

import java.io.*;
import java.security.Principal;
import java.util.*;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletInputStream;
import javax.servlet.http.*;
import org.eclipse.equinox.http.*;
import org.eclipse.equinox.socket.SocketInterface;
import org.eclipse.osgi.util.NLS;
import org.osgi.service.http.HttpContext;

/**
 * Implementation of the HttpServletRequest interface
 *
 * Per Servlet 2.2 Section 3.3.3.3, this object need not be thread-safe.
 */

public class HttpServletRequestImpl implements HttpServletRequest {

	protected Http http;
	protected HttpServletResponseImpl response;
	protected SocketInterface socket;
	protected ServletInputStreamImpl servletInputStream;
	protected String scheme;
	protected String authType = null;
	protected String remoteUser = null;

	protected int contentLength = -2;
	protected String contentType = null;
	protected String serverName = null;

	protected Hashtable parameters = null;
	protected Hashtable attributes = null;
	protected BufferedReader reader = null;
	protected ServletInputStream inputstream = null;
	protected Cookie[] cookies;

	//request-line variables
	protected String method = null;
	protected String reqURI = null; /* URI decoded */
	protected String protocol = null;
	protected String servletPath = null;
	protected String pathInfo = null; /* URI decoded */
	protected String queryString = null;
	protected String charset = null;

	protected Hashtable headers = null;
	protected HttpSessionImpl session;
	protected String requestedSessionId = null;
	protected ServletContextImpl servletContext;

	protected boolean parsedQueryData = false;

	public HttpServletRequestImpl(SocketInterface socket, Http http, HttpServletResponseImpl response) throws IOException {
		this.response = response;
		this.socket = socket;
		this.http = http;
		scheme = socket.getScheme();

		servletInputStream = new ServletInputStreamImpl(socket.getInputStream());

		response.setRequest(this);

		parseHeaders(); /* allocate headers Hashtable */
	}

	/**
	 * Initialize additional request data.
	 *
	 * @param servletPath URI alias for this request
	 * @param servletContext ServletContext for this request
	 */
	public void init(String servletPath, ServletContextImpl servletContext) {
		// BUGBUG Need to deal with context path
		// Servlet 2.2 Section 5.4
		this.servletPath = servletPath;
		this.servletContext = servletContext;

		int len = servletPath.length();

		String pathInfo = reqURI.substring(servletPath.length());
		if ((pathInfo.length() == 0) || pathInfo.equals("/")) //$NON-NLS-1$
		{
			/* leave as null */
		} else {
			this.pathInfo = pathInfo;
		}

		if (authType == null) {
			Object obj = getAttribute(HttpContext.AUTHENTICATION_TYPE);
			if (obj instanceof String) {
				authType = (String) obj;
			}
		}

		if (remoteUser == null) {
			Object obj = getAttribute(HttpContext.REMOTE_USER);
			if (obj instanceof String) {
				remoteUser = (String) obj;
			}
		}
	}

	/**
	 * Returns the value of the named attribute of the request, or
	 * null if the attribute does not exist.  This method allows
	 * access to request information not already provided by the other
	 * methods in this interface.  Attribute names should follow the
	 * same convention as package names.
	 * The following predefined attributes are provided.
	 *
	 * <TABLE BORDER>
	 * <tr>
	 *	<th>Attribute Name</th>
	 *	<th>Attribute Type</th>
	 *	<th>Description</th>
	 *	</tr>
	 *
	 * <tr>
	 *	<td VALIGN=TOP>javax.net.ssl.cipher_suite</td>
	 *	<td VALIGN=TOP>string</td>
	 *	<td>The string name of the SSL cipher suite in use, if the
	 *		request was made using SSL</td>
	 *	</tr>
	 *
	 * <tr>
	 *	<td VALIGN=TOP>javax.net.ssl.peer_certificates</td>
	 *	<td VALIGN=TOP>array of javax.security.cert.X509Certificate</td>
	 *	<td>The chain of X.509 certificates which authenticates the client.
	 *		This is only available when SSL is used with client
	 *		authentication is used.</td>
	 *	</tr>
	 *
	 * <tr>
	 *	<td VALIGN=TOP>javax.net.ssl.session</td>
	 *	<td VALIGN=TOP>javax.net.ssl.SSLSession</td>
	 *	<td>An SSL session object, if the request was made using SSL.</td>
	 *	</tr>
	 *
	 * </TABLE>
	 *
	 * <BR>
	 * <P>The package (and hence attribute) names beginning with java.*,
	 * and javax.* are reserved for use by Javasoft. Similarly, com.sun.*
	 * is reserved for use by Sun Microsystems.
	 *
	 * @param name the name of the attribute whose value is required
	 */
	public Object getAttribute(String name) {
		if (attributes != null) {
			return (attributes.get(name));
		}
		return (null);
	}

	/**
	 * Returns an enumeration of attribute names contained in this request.
	 */

	public Enumeration getAttributeNames() {
		if (attributes != null) {
			return (attributes.keys());
		}
		return (new Vector(0).elements());
	}

	/**
	 * Gets the authentication scheme of this request.  Same as the CGI
	 * variable AUTH_TYPE.
	 *
	 * @return this request's authentication scheme, or null if none.
	 */
	public String getAuthType() {
		return (authType);
	}

	/**
	 * Returns the character set encoding for the input of this request.
	 */
	public String getCharacterEncoding() {
		if (contentType == null) {
			getContentType(); /* parse the content type */
		}

		return (charset);
	}

	/**
	 * Returns the size of the request entity data, or -1 if not known.
	 * Same as the CGI variable CONTENT_LENGTH.
	 */
	public int getContentLength() {
		if (contentLength == -2) {
			contentLength = getIntHeaderUpper("CONTENT-LENGTH"); //$NON-NLS-1$
		}
		return (contentLength);
	}

	/**
	 * Returns the Internet Media Type of the request entity data, or
	 * null if not known. Same as the CGI variable CONTENT_TYPE.
	 */

	public String getContentType() {
		if (contentType == null) {
			contentType = getHeaderUpper("CONTENT-TYPE"); //$NON-NLS-1$

			if (contentType != null) {
				int index = contentType.indexOf(';', 0);
				if (index >= 0) {
					Tokenizer tokenizer = new Tokenizer(contentType);

					String mime_type = tokenizer.getToken(";"); //$NON-NLS-1$
					tokenizer.getChar(); /* eat semicolon */

					parseloop: while (true) {
						String attribute = tokenizer.getToken("="); //$NON-NLS-1$
						char c = tokenizer.getChar();

						if (c != '=') {
							break parseloop; /* invalid content type */
						}

						String value = tokenizer.getString(";"); //$NON-NLS-1$
						c = tokenizer.getChar();

						if ("charset".equalsIgnoreCase(attribute)) //$NON-NLS-1$
						{
							charset = value;
						}

						if (c == '\0') {
							break parseloop;
						}
					}
				}
			}
		}

		return (contentType);
	}

	/**
	 * Gets an array of cookies found in this request.  If no cookies are present, an empty
	 * array was returned.
	 * @return the array of cookies found in this request
	 */
	public Cookie[] getCookies() {
		parseCookies();

		return ((Cookie[]) cookies.clone());
	}

	/**
	 * Gets the value of the requested date header field of this
	 * request.  If the header can't be converted to a date, the method
	 * throws an IllegalArgumentException.  The case of the header
	 * field name is ignored.
	 *
	 * From HTTP/1.1 RFC 2616
	 * 3.3.1 Full Date
	 *
	 *    HTTP applications have historically allowed three different formats
	 *    for the representation of date/time stamps:
	 *
	 *       Sun, 06 Nov 1994 08:49:37 GMT  ; RFC 822, updated by RFC 1123
	 *       Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
	 *       Sun Nov  6 08:49:37 1994       ; ANSI C's asctime() format
	 *
	 *    The first format is preferred as an Internet standard and represents
	 *    a fixed-length subset of that defined by RFC 1123 [8] (an update to
	 *    RFC 822 [9]). The second format is in common use, but is based on the
	 *    obsolete RFC 850 [12] date format and lacks a four-digit year.
	 *    HTTP/1.1 clients and servers that parse the date value MUST accept
	 *    all three formats (for compatibility with HTTP/1.0), though they MUST
	 *    only generate the RFC 1123 format for representing HTTP-date values
	 *    in header fields. See section 19.3 for further information.
	 *
	 *       Note: Recipients of date values are encouraged to be robust in
	 *       accepting date values that may have been sent by non-HTTP
	 *       applications, as is sometimes the case when retrieving or posting
	 *       messages via proxies/gateways to SMTP or NNTP.
	 *
	 *    All HTTP date/time stamps MUST be represented in Greenwich Mean Time
	 *    (GMT), without exception. For the purposes of HTTP, GMT is exactly
	 *    equal to UTC (Coordinated Universal Time). This is indicated in the
	 *    first two formats by the inclusion of "GMT" as the three-letter
	 *    abbreviation for time zone, and MUST be assumed when reading the
	 *    asctime format. HTTP-date is case sensitive and MUST NOT include
	 *    additional LWS beyond that specifically included as SP in the
	 *    grammar.
	 *
	 *        HTTP-date    = rfc1123-date | rfc850-date | asctime-date
	 *        rfc1123-date = wkday "," SP date1 SP time SP "GMT"
	 *        rfc850-date  = weekday "," SP date2 SP time SP "GMT"
	 *        asctime-date = wkday SP date3 SP time SP 4DIGIT
	 *        date1        = 2DIGIT SP month SP 4DIGIT
	 *                       ; day month year (e.g., 02 Jun 1982)
	 *        date2        = 2DIGIT "-" month "-" 2DIGIT
	 *                       ; day-month-year (e.g., 02-Jun-82)
	 *        date3        = month SP ( 2DIGIT | ( SP 1DIGIT ))
	 *                       ; month day (e.g., Jun  2)
	 *        time         = 2DIGIT ":" 2DIGIT ":" 2DIGIT
	 *                       ; 00:00:00 - 23:59:59
	 *        wkday        = "Mon" | "Tue" | "Wed"
	 *                     | "Thu" | "Fri" | "Sat" | "Sun"
	 *        weekday      = "Monday" | "Tuesday" | "Wednesday"
	 *                     | "Thursday" | "Friday" | "Saturday" | "Sunday"
	 *        month        = "Jan" | "Feb" | "Mar" | "Apr"
	 *                     | "May" | "Jun" | "Jul" | "Aug"
	 *                     | "Sep" | "Oct" | "Nov" | "Dec"
	 *
	 *       Note: HTTP requirements for the date/time stamp format apply only
	 *       to their usage within the protocol stream. Clients and servers are
	 *       not required to use these formats for user presentation, request
	 *       logging, etc.
	 *
	 * @param name the String containing the name of the requested
	 * header field
	 * @return the value the requested date header field, or -1 if not
	 * found.
	 */
	public long getDateHeader(String name) {
		//headers are stored as strings and must be converted
		String date = getHeader(name);

		if (date != null) {
			HttpDate d = new HttpDate(date);

			if (d.isValid()) {
				return (d.getAsLong()); // Parsed OK, so get the value as a Long
			} else {
				throw new IllegalArgumentException();
			}
		}

		return (-1);
	}

	/**
	 * Gets the value of the requested header field of this request.
	 * The case of the header field name is ignored.
	 *
	 * @param name the String containing the name of the requested
	 * header field
	 * @return the value of the requested header field, or null if not
	 * known.
	 */

	//This should be case insensitive
	public String getHeader(String name) {
		return ((String) headers.get(name.toUpperCase()));
	}

	/**
	 * Gets the header names for this request.
	 *
	 * @return an enumeration of strings representing the header names
	 * for this request. Some server implementations do not allow
	 * headers to be accessed in this way, in which case this method
	 * will return null.
	 */
	public Enumeration getHeaderNames() {
		return (headers.keys());
	}

	protected String getHeaderUpper(String name) {
		return ((String) headers.get(name));
	}

	/**
	 * Returns an input stream for reading binary data in the request body.
	 *
	 * @see getReader
	 * @exception IllegalStateException if getReader has been
	 *	called on this same request.
	 * @exception IOException on other I/O related errors.
	 */
	public ServletInputStream getInputStream() {
		if (inputstream == null) {
			synchronized (this) {
				if (inputstream == null) {
					if (reader != null) {
						throw new IllegalStateException();
					}

					inputstream = servletInputStream.getServletInputStream(getContentLength());
				}
			}
		}

		return (inputstream);
	}

	/**
	 * Gets the value of the specified integer header field of this
	 * request.  The case of the header field name is ignored.  If the
	 * header can't be converted to an integer, the method throws a
	 * NumberFormatException.
	 *
	 * @param name the String containing the name of the requested
	 * header field
	 * @return the value of the requested header field, or -1 if not
	 * found.
	 */

	//This lookup is case insensitive
	public int getIntHeader(String name) {
		String value = getHeader(name);

		if (value != null) {
			return (Integer.parseInt(value));
		}

		return (-1);
	}

	protected int getIntHeaderUpper(String name) {
		String value = getHeaderUpper(name);

		if (value != null) {
			return (Integer.parseInt(value));
		}

		return (-1);
	}

	/**
	 * Gets the HTTP method (for example, GET, POST, PUT) with which
	 * this request was made. Same as the CGI variable REQUEST_METHOD.
	 *
	 * @return the HTTP method with which this request was made
	 */
	public String getMethod() {
		return (method);
	}

	/**
	 * Returns a string containing the lone value of the specified
	 * parameter, or null if the parameter does not exist. For example,
	 * in an HTTP servlet this method would return the value of the
	 * specified query string parameter. Servlet writers should use
	 * this method only when they are sure that there is only one value
	 * for the parameter.  If the parameter has (or could have)
	 * multiple values, servlet writers should use
	 * getParameterValues. If a multiple valued parameter name is
	 * passed as an argument, the return value is implementation
	 * dependent.
	 *
	 * @see #getParameterValues
	 *
	 * @param name the name of the parameter whose value is required.
	 */
	public String getParameter(String name) {
		String[] values = getParameterValues(name);

		if ((values != null) && (values.length > 0)) {
			return (values[0]);
		}

		return (null);
	}

	/**
	 * Returns the parameter names for this request as an enumeration
	 * of strings, or an empty enumeration if there are no parameters
	 * or the input stream is empty.  The input stream would be empty
	 * if all the data had been read from the stream returned by the
	 * method getInputStream.
	 */
	public Enumeration getParameterNames() {
		if (!parsedQueryData) {
			parseQueryData();
		}

		if (parameters != null) {
			return (parameters.keys());
		}

		return (new Vector(0).elements());
	}

	/**
	 * Returns the values of the specified parameter for the request as
	 * an array of strings, or null if the named parameter does not
	 * exist. For example, in an HTTP servlet this method would return
	 * the values of the specified query string or posted form as an
	 * array of strings.
	 *
	 * @param name the name of the parameter whose value is required.
	 * @see javax.servlet.ServletRequest#getParameter
	 */
	public String[] getParameterValues(String name) {
		if (!parsedQueryData) {
			parseQueryData();
		}

		if (parameters != null) {
			return ((String[]) parameters.get(name));
		}

		return (null);
	}

	/**
	 * Gets any optional extra path information following the servlet
	 * path of this request's URI, but immediately preceding its query
	 * string. Same as the CGI variable PATH_INFO.
	 *
	 * @return the optional path information following the servlet
	 * path, but before the query string, in this request's URI; null
	 * if this request's URI contains no extra path information
	 */
	public String getPathInfo() {
		return (pathInfo);
	}

	/**
	 * Gets any optional extra path information following the servlet
	 * path of this request's URI, but immediately preceding its query
	 * string, and translates it to a real path.  Similar to the CGI
	 * variable PATH_TRANSLATED
	 *
	 * @return extra path information translated to a real path or null
	 * if no extra path information is in the request's URI
	 */
	public String getPathTranslated() {
		// JSP 1.0 Section B.5
		return servletContext.getRealPath(getPathInfo());
	}

	/**
	 * Returns the protocol and version of the request as a string of
	 * the form <code>&lt;protocol&gt;/&lt;major version&gt;.&lt;minor
	 * version&gt</code>.  Same as the CGI variable SERVER_PROTOCOL.
	 */
	public String getProtocol() {
		return (protocol);
	}

	/**
	 * Gets any query string that is part of the HTTP request URI.
	 * Same as the CGI variable QUERY_STRING.
	 *
	 * @return query string that is part of this request's URI, or null
	 * if it contains no query string
	 */
	public String getQueryString() {
		return (queryString);
	}

	/**
	 * Returns a buffered reader for reading text in the request body.
	 * This translates character set encodings as appropriate.
	 *
	 * @see getInputStream
	 *
	 * @exception UnsupportedEncodingException if the character set encoding
	 *  is unsupported, so the text can't be correctly decoded.
	 * @exception IllegalStateException if getInputStream has been
	 *	called on this same request.
	 * @exception IOException on other I/O related errors.
	 */
	public BufferedReader getReader() {
		if (reader == null) {
			synchronized (this) {
				if (reader == null) {
					if (inputstream != null) {
						throw new IllegalStateException();
					}

					// BUGBUG Must create reader with charset getCharacterEncoding or iso-8859-1 if null.
					// Servlet 2.3 Section 4.9
					reader = new BufferedReader(new InputStreamReader(servletInputStream.getServletInputStream(getContentLength())));
				}
			}
		}

		return (reader);
	}

	/**
	 * Applies alias rules to the specified virtual path and returns
	 * the corresponding real path, or null if the translation can not
	 * be performed for any reason.  For example, an HTTP servlet would
	 * resolve the path using the virtual docroot, if virtual hosting
	 * is enabled, and with the default docroot otherwise.  Calling
	 * this method with the string "/" as an argument returns the
	 * document root.
	 *
	 * @param path the virtual path to be translated to a real path
	 * *deprecated
	 */
	public String getRealPath(String path) {
		return servletContext.getRealPath(path);
	}

	/**
	 * Returns the IP address of the agent that sent the request.
	 * Same as the CGI variable REMOTE_ADDR.
	 */
	public String getRemoteAddr() {
		return (socket.getInetAddress().getHostAddress());
	}

	/**
	 * Returns the fully qualified host name of the agent that sent the
	 * request. Same as the CGI variable REMOTE_HOST.
	 */
	public String getRemoteHost() {
		return (socket.getInetAddress().getHostName());
	}

	/**
	 * Gets the name of the user making this request.  The user name is
	 * set with HTTP authentication.  Whether the user name will
	 * continue to be sent with each subsequent communication is
	 * browser-dependent.  Same as the CGI variable REMOTE_USER.
	 *
	 * @return the name of the user making this request, or null if not
	 * known.
	 */
	public String getRemoteUser() {
		return (remoteUser);
	}

	/**
	 * Returns the session id specified with this request.  This may differ from
	 * the session id in the current session if the session id given by the
	 * client was invalid for whatever reason and a new session was created.
	 * This method will return null if the request does not have a session
	 * associated with it.
	 *
	 * @return the session id specified by this request, or null if the
	 * request did not specify a session id
	 *
	 * @see #isRequestedSessionIdValid */
	public String getRequestedSessionId() {
		parseCookies(); /* allocate cookies array */

		if (requestedSessionId == null) {
			String sessionCookieName = HttpSessionImpl.sessionCookieName;
			int numCookies = cookies.length;
			for (int i = 0; i < numCookies; i++) {
				Cookie cookie = cookies[i];
				if (sessionCookieName.equals(cookie.getName())) {
					requestedSessionId = cookie.getValue();
					break;
				}
			}
		}

		return (requestedSessionId);
	}

	/**
	 * Gets, from the first line of the HTTP request, the part of this
	 * request's URI that is to the left of any query string.
	 * For example,
	 *
	 * <blockquote>
	 * <table>
	 * <tr align=left><th>First line of HTTP request<th>
	 * <th>Return from <code>getRequestURI</code>
	 * <tr><td>POST /some/path.html HTTP/1.1<td><td>/some/path.html
	 * <tr><td>GET http://foo.bar/a.html HTTP/1.0
	 * <td><td>http://foo.bar/a.html
	 * <tr><td>HEAD /xyz?a=b HTTP/1.1<td><td>/xyz
	 * </table>
	 * </blockquote>
	 *
	 * <p>To reconstruct a URL with a URL scheme and host, use the
	 * method javax.servlet.http.HttpUtils.getRequestURL, which returns
	 * a StringBuffer.
	 *
	 * @return this request's URI
	 * @see javax.servlet.http.HttpUtils#getRequestURL
	 */
	public String getRequestURI() {
		// BUGBUG this should probably be URI encoded?
		// Servlet 2.2 Section 5.4
		return (reqURI);
	}

	/**
	 * Returns the scheme of the URL used in this request, for example
	 * "http", "https", or "ftp".  Different schemes have different
	 * rules for constructing URLs, as noted in RFC 1738.  The URL used
	 * to create a request may be reconstructed using this scheme, the
	 * server name and port, and additional information such as URIs.
	 */
	public String getScheme() {
		return (scheme);
	}

	/**
	 * Returns the host name of the server that received the request.
	 * Same as the CGI variable SERVER_NAME.
	 */
	public String getServerName() {

		if (serverName == null) {
			String value = getHeaderUpper("HOST"); //$NON-NLS-1$
			if (value != null) {
				int n = value.indexOf(':');
				if (n < 0) {
					serverName = value;
				} else {
					serverName = value.substring(0, n).trim();
				}
			} else {
				serverName = socket.getLocalAddress().getHostName();
			}
		}
		return serverName;
	}

	/**
	 * Returns the port number on which this request was received.
	 * Same as the CGI variable SERVER_PORT.
	 */
	public int getServerPort() {
		return (socket.getLocalPort());
	}

	/**
	 * Gets the part of this request's URI that refers to the servlet
	 * being invoked. Analogous to the CGI variable SCRIPT_NAME.
	 *
	 * @return the servlet being invoked, as contained in this
	 * request's URI
	 */
	public String getServletPath() {
		return (servletPath);
	}

	/**
	 * Returns the current valid session associated with this request.
	 * A session will be created for the
	 * request if there is not already a session associated with the request.
	 *
	 * To ensure the session is properly
	 * maintained, the servlet developer must call this method before the
	 * response is committed.
	 *
	 * @return the session associated with this request.
	 */
	public HttpSession getSession() {
		return (getSession(true));
	}

	/**
	 * Returns the current valid session associated with this request.
	 * If there is not already a session associated with the request,
	 * a session will be created for the request only
	 * if the argument is true.
	 *
	 * To ensure the session is properly
	 * maintained, the servlet developer must call this method before the
	 * response is committed.
	 *
	 * If the create flag is set to false and no session
	 * is associated with this request, then this method will return null.
	 *
	 * <p><b>Note</b>: to ensure the session is properly maintained,
	 * the servlet developer must call this method (at least once)
	 * before any output is written to the response.
	 *
	 * <p>Additionally, application-writers need to be aware that newly
	 * created sessions (that is, sessions for which
	 * <code>HttpSession.isNew</code> returns true) do not have any
	 * application-specific state.
	 *
	 * @return the session associated with this request or null if
	 * create was false and no valid session is associated
	 * with this request.
	 */
	public synchronized HttpSession getSession(boolean create) {
		if (session != null) /* if session cached in this request */
		{
			/* test to see if the session is still valid */
			if (session.isValid(false)) {
				return (session);
			}

			session = null; /* dereference invalid session */
		} else {
			/* Session is not cached in this request
			 * Check to see if the client requested a session id.
			 */

			String sessionId = getRequestedSessionId();
			if (sessionId != null) {
				session = http.getSession(sessionId);

				if (session != null) /* valid session in cache */
				{
					return (session);
				}
			}
		}

		// we didn't get a valid session, so create one if desired
		if (create) {
			session = new HttpSessionImpl(http);
			response.addCookie(session.getCookie());
			return (session);
		}

		// Nothing we did produced a valid session, and the caller
		// didn't ask us to create one.
		return (null);
	}

	/**
	 * Checks whether the session id specified by this request came in
	 * as a cookie.  (The requested session may not be one returned by
	 * the <code>getSession</code> method.)
	 *
	 * @return true if the session id specified by this request came in
	 * as a cookie; false otherwise
	 *
	 * @see #getSession
	 */
	public boolean isRequestedSessionIdFromCookie() {
		/* We always use cookies. If there is a requestedSessionId,
		 * it came from a Cookie.
		 */
		return (getRequestedSessionId() != null);
	}

	/**
	 * Checks whether the session id specified by this request came in
	 * as part of the URL.  (The requested session may not be the one
	 * returned by the <code>getSession</code> method.)
	 *
	 * @return true if the session id specified by the request for this
	 * session came in as part of the URL; false otherwise
	 *
	 * @see #getSession
	 *
	 * @deprecated use isRequestSessionIdFromURL() instead
	 */
	public boolean isRequestedSessionIdFromUrl() {
		return (isRequestedSessionIdFromURL());
	}

	/**
	 * Checks whether the session id specified by this request came in
	 * as part of the URL.  (The requested session may not be the one
	 * returned by the <code>getSession</code> method.)
	 *
	 * @return true if the session id specified by the request for this
	 * session came in as part of the URL; false otherwise
	 *
	 * @see #getSession
	 */

	public boolean isRequestedSessionIdFromURL() {
		/* We do not support URL rewriting. We use cookies. */
		return (false);
	}

	/**
	 * This method checks whether this request is associated with a session
	 * that is currently valid.  If the session used by the request is not valid,
	 * it will not be returned via the getSession method.
	 *
	 * @return true if the request session is valid.
	 *
	 * @see #getRequestedSessionId
	 * @see javax.servlet.http.HttpSessionContext
	 * @see #getSession
	 */
	public boolean isRequestedSessionIdValid() {
		HttpSession session = getSession(false); /* get current session, if any */

		if (session != null) /* if there is a session, see if it the requested session */
		{
			return (session.getId().equals(getRequestedSessionId()));
		}

		return (false);
	}

	protected synchronized void parseCookies() {
		if (cookies == null) {
			nocookies: {
				String cookieHeader = getHeaderUpper("COOKIE"); //$NON-NLS-1$
				if (cookieHeader == null) {
					break nocookies;
				}
				Vector cookieVector = new Vector(20);
				int cookieVersion = 0;

				//parse through cookie header for all cookies

				Tokenizer tokenizer = new Tokenizer(cookieHeader);

				String name = tokenizer.getToken("="); //$NON-NLS-1$
				char c = tokenizer.getChar();
				String value;

				if (name.equals("$Version")) //$NON-NLS-1$
				{
					if (c != '=') {
						if (Http.DEBUG) {
							http.logDebug("Cookie parse error", new Exception()); //$NON-NLS-1$
						}
						break nocookies;
					}

					value = tokenizer.getString(";,"); //$NON-NLS-1$

					try {
						cookieVersion = Integer.parseInt(value);
					} catch (NumberFormatException e) {
						if (Http.DEBUG) {
							http.logDebug("Cookie version error", e); //$NON-NLS-1$
						}
					}

					name = null;
				}

				parseloop: while (true) {
					if (name == null) {
						name = tokenizer.getToken("="); //$NON-NLS-1$
						c = tokenizer.getChar();
					}

					if (c != '=') {
						if (Http.DEBUG) {
							http.logDebug("Cookie parse error", new Exception()); //$NON-NLS-1$
						}
						break nocookies;
					}

					value = tokenizer.getString(";,"); //$NON-NLS-1$
					c = tokenizer.getChar();

					Cookie cookie;
					try {
						cookie = new Cookie(name, value);
					} catch (IllegalArgumentException e) {
						if (Http.DEBUG) {
							http.logDebug("Cookie constructor error", e); //$NON-NLS-1$
						}
						break nocookies;
					}
					cookie.setVersion(cookieVersion);

					cookieVector.addElement(cookie);

					if (c == '\0') {
						break parseloop;
					}

					name = tokenizer.getToken("="); //$NON-NLS-1$
					c = tokenizer.getChar();
					if (name.equals("$Path")) //$NON-NLS-1$
					{
						if (c != '=') {
							if (Http.DEBUG) {
								http.logDebug("Cookie parse error", new Exception()); //$NON-NLS-1$
							}
							break nocookies;
						}
						cookie.setPath(tokenizer.getString(";,")); //$NON-NLS-1$

						c = tokenizer.getChar();
						if (c == '\0') {
							break parseloop;
						}

						name = tokenizer.getToken("="); //$NON-NLS-1$
						c = tokenizer.getChar();
					}

					if (name.equals("$Domain")) //$NON-NLS-1$
					{
						if (c != '=') {
							if (Http.DEBUG) {
								http.logDebug("Cookie parse error", new Exception()); //$NON-NLS-1$
							}
							break nocookies;
						}
						cookie.setDomain(tokenizer.getString(";,")); //$NON-NLS-1$

						c = tokenizer.getChar();
						if (c == '\0') {
							break parseloop;
						}

						name = null;
					}
				}

				if (cookieVector.size() > 0) {
					cookies = new Cookie[cookieVector.size()];
					cookieVector.copyInto(cookies);
					return;
				}
			}

			cookies = new Cookie[0];
		}
	}

	protected void parseHeaders() throws IOException {
		headers = new Hashtable(31);
		byte[] buffer = new byte[4096];

		/* The first line in an http request is always the request-line. */
		String line = readHeaderLine(buffer);

		if (line.length() == 0) {
			throw new InterruptedIOException(HttpMsg.HTTP_NO_HEADER_LINE_READ_EXCEPTION);
		}

		socket.markActive(); /* indicate we are processing a request */

		parseRequestLine(line);

		/* Now we get to the headers. */
		// BUGBUG Headers can be repeated! getHeader must return the first header
		// in the request. The (2.2) getHeaders method can be used to get all
		// the headers' values.
		// Servlet 2.2 Section 5.3
		boolean firstLine = true;
		String header = null;
		StringBuffer value = new StringBuffer(256);
		while (true) {
			line = readHeaderLine(buffer);

			if (line.length() == 0) { //End of headers
				if (!firstLine) /* flush last line */
				{
					headers.put(header, value.toString().trim());
				}
				break;
			}

			//          System.out.println(line);

			char c = line.charAt(0);
			if ((c == ' ') || (c == '\t')) /* continuation */
			{
				if (firstLine) /* if no previous line */
				{
					throw new IOException(NLS.bind(HttpMsg.HTTP_INVALID_HEADER_LINE_EXCEPTION, line));
				}
				value.append(line.substring(1));
				continue;
			}

			if (!firstLine) {
				headers.put(header, value.toString().trim());
				value.setLength(0); /* clear StringBuffer */
			}

			//use ':' as a delimeter to separate the key and the value
			int colon = line.indexOf(':', 0);

			// Our keys are saved as upper case so we can do case-insensitive
			// searches on them.
			header = line.substring(0, colon).toUpperCase();
			value.append(line.substring(colon + 1));
			firstLine = false;
		}//while
	}

	/**
	 * This methods MUST only be called by one of the getParameter methods
	 * Servlet 2.2 Section 5.1
	 */
	protected synchronized void parseQueryData() {
		if (!parsedQueryData) {
			try {
				/* Request parameters must come from BOTH the query string
				 * and the POST data. Query string must be processed before POST data.
				 * Servlet 2.2 Section 5.1.
				 */

				if (queryString != null) {
					if (parameters == null) {
						parameters = new Hashtable();
					}

					parseQueryString(parameters, queryString, null);
				}

				/* POST data must only be read if the following conditions are
				 * true
				 * 1. getScheme is "http" or "https"
				 * 2. getMethod is "POST"
				 * 3. getContextType is "application/x-www-form-urlencoded"
				 * 4. servlet calls getParameter* method.
				 * Servlet 2.2 Section 5.1
				 */
				String content_type = getContentType();

				if (content_type != null) {
					int index = content_type.indexOf(';', 0);
					if (index >= 0) {
						content_type = content_type.substring(0, index).trim();
					}
				}

				if ("POST".equals(method) && //$NON-NLS-1$
						("http".equals(scheme) || "https".equals(scheme)) && //$NON-NLS-1$ //$NON-NLS-2$
						"application/x-www-form-urlencoded".equals(content_type) //$NON-NLS-1$
				) {
					int content_length = getContentLength();
					if (content_length > 0) {
						//                      System.out.println("Read POST data");
						/* Read the post data from the ServletInputStream */
						ServletInputStream in = getInputStream();
						byte buffer[] = new byte[content_length];
						int bytesRead = 0;
						while (bytesRead < content_length) {
							int count;

							try {
								count = in.read(buffer, bytesRead, content_length - bytesRead);
							} catch (IOException e) {
								throw new IllegalArgumentException();
							}

							if (count < 1) {
								break;
							}

							bytesRead += count;
						}

						String encoding = getCharacterEncoding();

						/* Must use charset getCharacterEncoding or iso-8859-1 if null.
						 * Servlet 2.3 Section 4.9
						 */

						String postData = URI.convert(buffer, 0, bytesRead, encoding);

						if (parameters == null) {
							parameters = new Hashtable();
						}

						parseQueryString(parameters, postData, encoding);
					}
				}
			} catch (Exception e) {
				//Bad query string, ignore, log and continue
				http.logError(HttpMsg.HTTP_QUERYDATA_PARSE_EXCEPTION, e);
			}

			parsedQueryData = true;
		}
	}

	/**
	 * Parses a query string and builds a hashtable of key-value
	 * pairs, where the values are arrays of strings.  The query string
	 * should have the form of a string packaged by the GET or POST
	 * method.  (For example, it should have its key-value pairs
	 * delimited by ampersands (&) and its keys separated from its
	 * values by equal signs (=).)
	 *
	 * <p> A key can appear one or more times in the query string.
	 * Each time a key appears, its corresponding value is inserted
	 * into its string array in the hash table.  (So keys that appear
	 * once in the query string have, in the hash table, a string array
	 * of length one as their value, keys that appear twice have a
	 * string array of length two, etc.)
	 *
	 * <p> When the keys and values are moved into the hashtable, any
	 * plus signs (+) are returned to spaces and characters sent in
	 * hexadecimal notation (%xx) are converted back to characters.
	 *
	 * @param data query string to be parsed
	 * @param result a hashtable built from the parsed key-value pairs; the
	 *.hashtable's values are arrays of strings
	 * @exception IllegalArgumentException if the query string is
	 * invalid.
	 */
	protected void parseQueryString(Hashtable result, String data, String encoding) {
		if (data == null) {
			throw new IllegalArgumentException();
		}

		//      System.out.println("Querystring: " + data);

		data = data.trim(); /* Strip CRLF if present */

		int len = data.length();

		if (len >= 0) {
			int begin = 0;

			while (true) {
				int end = data.indexOf('&', begin);
				if (end == -1) {
					end = len;
				}

				int equals = data.indexOf('=', begin);

				String key;
				String value;
				if ((equals >= end) || (equals == -1)) {
					key = URI.decode(data, begin, end, encoding);
					value = ""; //$NON-NLS-1$
				} else {
					key = URI.decode(data, begin, equals, encoding);
					value = URI.decode(data, equals + 1, end, encoding);
				}

				String[] values = (String[]) result.get(key);

				if (values == null) {
					values = new String[1];
					values[0] = value;
					result.put(key, values);
				} else {
					int length = values.length;
					String[] newvalues = new String[length + 1];
					System.arraycopy(values, 0, newvalues, 0, length);
					newvalues[length] = value;
					result.put(key, newvalues);
				}

				if (end == len) {
					break;
				}

				begin = end + 1;
			}
		}
	}

	/**
	 * This method was created in VisualAge.
	 * @return java.lang.String
	 * @param requestLine java.lang.String
	 */
	protected void parseRequestLine(String requestLine) {
		if (Http.DEBUG) {
			http.logDebug("Http Request Line=\"" + requestLine + "\""); //$NON-NLS-1$ //$NON-NLS-2$
		}
		//      System.out.println("Http Request Line=\"" + requestLine + "\"");

		int space = requestLine.indexOf(' ', 0);
		method = requestLine.substring(0, space);

		int nextspace = requestLine.lastIndexOf(' ');
		protocol = requestLine.substring(nextspace + 1);

		int query = requestLine.indexOf('?', space + 1);

		if ((query >= nextspace) || (query == -1)) {
			reqURI = URI.decode(requestLine, space + 1, nextspace, null);
		} else {
			reqURI = URI.decode(requestLine, space + 1, query, null);
			queryString = requestLine.substring(query + 1, nextspace);
		}
	}

	/**
	 * This method is only used by the constructor (albiet indirectly)
	 * @return java.lang.String
	 */
	protected String readHeaderLine(byte[] buffer) throws IOException {
		int read = servletInputStream.readLine(buffer, 0, buffer.length);
		if (read <= 0) {
			throw new InterruptedIOException(HttpMsg.HTTP_NO_HEADER_LINE_READ_EXCEPTION);
		}

		// BUGBUG should use 8859_1 encoding to make string
		/* create String from byte array using 0 for high byte of chars */
		String line = URI.convert(buffer, 0, read, null);

		if (line.endsWith("\n")) //$NON-NLS-1$
		{
			return (line.trim()); /* trim removes trailing CRLF */
		}

		try {
			response.sendError(response.SC_REQUEST_ENTITY_TOO_LARGE);
		} finally {
			response.close();
		}

		throw new IOException(NLS.bind(HttpMsg.HTTP_HEADER_LINE_TOO_LONG_EXCEPTION, new Integer(buffer.length)));
	}

	/**
	 * This method places an attribute into the request for later use by
	 * other objects which will have access to this request object such as
	 * nested servlets.
	 *
	 * @param name Attribute name
	 * @param object Attribute value
	 */
	public void setAttribute(String name, Object val) {
		if (attributes == null) {
			synchronized (this) {
				if (attributes == null) {
					attributes = new Hashtable(31);
				}
			}
		}

		if (val == null) {
			attributes.remove(name);
		} else {
			attributes.put(name, val);
		}
	}

	/**
	 * @see javax.servlet.http.HttpServletRequest#getContextPath()
	 */
	public String getContextPath() throws UnsupportedOperationException {
		throw new UnsupportedOperationException(HttpMsg.HTTP_ONLY_SUPPORTS_2_1);
	}

	/**
	 * @see javax.servlet.http.HttpServletRequest#getHeaders(String)
	 */
	public Enumeration getHeaders(String name) throws UnsupportedOperationException {
		throw new UnsupportedOperationException(HttpMsg.HTTP_ONLY_SUPPORTS_2_1);
	}

	/**
	 * @see javax.servlet.http.HttpServletRequest#getRequestURL()
	 */
	public StringBuffer getRequestURL() throws UnsupportedOperationException {
		throw new UnsupportedOperationException(HttpMsg.HTTP_ONLY_SUPPORTS_2_1);
	}

	/**
	 * @see javax.servlet.http.HttpServletRequest#getUserPrincipal()
	 */
	public Principal getUserPrincipal() throws UnsupportedOperationException {
		throw new UnsupportedOperationException(HttpMsg.HTTP_ONLY_SUPPORTS_2_1);
	}

	/**
	 * @see javax.servlet.http.HttpServletRequest#isUserInRole(String)
	 */
	public boolean isUserInRole(String role) throws UnsupportedOperationException {
		throw new UnsupportedOperationException(HttpMsg.HTTP_ONLY_SUPPORTS_2_1);
	}

	/**
	 * @see javax.servlet.ServletRequest#getLocale()
	 */
	public Locale getLocale() throws UnsupportedOperationException {
		throw new UnsupportedOperationException(HttpMsg.HTTP_ONLY_SUPPORTS_2_1);
	}

	/**
	 * @see javax.servlet.ServletRequest#getLocales()
	 */
	public Enumeration getLocales() throws UnsupportedOperationException {
		throw new UnsupportedOperationException(HttpMsg.HTTP_ONLY_SUPPORTS_2_1);
	}

	/**
	 * @see javax.servlet.ServletRequest#getParameterMap()
	 */
	public Map getParameterMap() throws UnsupportedOperationException {
		throw new UnsupportedOperationException(HttpMsg.HTTP_ONLY_SUPPORTS_2_1);
	}

	/**
	 * @see javax.servlet.ServletRequest#getRequestDispatcher(String)
	 */
	public RequestDispatcher getRequestDispatcher(String path) throws UnsupportedOperationException {
		throw new UnsupportedOperationException(HttpMsg.HTTP_ONLY_SUPPORTS_2_1);
	}

	/**
	 * @see javax.servlet.ServletRequest#isSecure()
	 */
	public boolean isSecure() throws UnsupportedOperationException {
		throw new UnsupportedOperationException(HttpMsg.HTTP_ONLY_SUPPORTS_2_1);
	}

	/**
	 * @see javax.servlet.ServletRequest#removeAttribute(String)
	 */
	public void removeAttribute(String name) throws UnsupportedOperationException {
		throw new UnsupportedOperationException(HttpMsg.HTTP_ONLY_SUPPORTS_2_1);
	}

	/**
	 * @see javax.servlet.ServletRequest#setCharacterEncoding(String)
	 */
	public void setCharacterEncoding(String env) throws UnsupportedEncodingException, UnsupportedOperationException {
		throw new UnsupportedOperationException(HttpMsg.HTTP_ONLY_SUPPORTS_2_1); //$NON-NLS-1$
	}

	/* For compilation only.  Will not implement.
	 * 
	 */
	public String getLocalAddr() {
		//return(socket.getInetAddress().getLocalHost().getHostAddress());
		throw new UnsupportedOperationException(HttpMsg.HTTP_ONLY_SUPPORTS_2_1); //$NON-NLS-1$
	}

	/* For compilation only.  Will not implement.
	 * 
	 */
	public String getLocalName() {
		//return(socket.getInetAddress().getLocalHost().getHostName());
		throw new UnsupportedOperationException(HttpMsg.HTTP_ONLY_SUPPORTS_2_1); //$NON-NLS-1$
	}

	/* For compilation only.  Will not implement.
	 * 
	 */
	public int getLocalPort() {
		throw new UnsupportedOperationException(HttpMsg.HTTP_ONLY_SUPPORTS_2_1); //$NON-NLS-1$
	}

	/* For compilation only.  Will not implement.
	 * 
	 */
	public int getRemotePort() {
		throw new UnsupportedOperationException(HttpMsg.HTTP_ONLY_SUPPORTS_2_1); //$NON-NLS-1$
	}
}

Back to the top