|
1 /* |
|
2 * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. |
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 * |
|
5 * This code is free software; you can redistribute it and/or modify it |
|
6 * under the terms of the GNU General Public License version 2 only, as |
|
7 * published by the Free Software Foundation. Oracle designates this |
|
8 * particular file as subject to the "Classpath" exception as provided |
|
9 * by Oracle in the LICENSE file that accompanied this code. |
|
10 * |
|
11 * This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 * version 2 for more details (a copy is included in the LICENSE file that |
|
15 * accompanied this code). |
|
16 * |
|
17 * You should have received a copy of the GNU General Public License version |
|
18 * 2 along with this work; if not, write to the Free Software Foundation, |
|
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 * |
|
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 * or visit www.oracle.com if you need additional information or have any |
|
23 * questions. |
|
24 */ |
|
25 |
|
26 package sun.net.httpserver; |
|
27 |
|
28 import java.io.*; |
|
29 import java.nio.*; |
|
30 import java.nio.channels.*; |
|
31 import java.net.*; |
|
32 import javax.net.ssl.*; |
|
33 import java.util.*; |
|
34 import com.sun.net.httpserver.*; |
|
35 import com.sun.net.httpserver.spi.*; |
|
36 |
|
37 class HttpExchangeImpl extends HttpExchange { |
|
38 |
|
39 ExchangeImpl impl; |
|
40 |
|
41 HttpExchangeImpl (ExchangeImpl impl) { |
|
42 this.impl = impl; |
|
43 } |
|
44 |
|
45 public Headers getRequestHeaders () { |
|
46 return impl.getRequestHeaders(); |
|
47 } |
|
48 |
|
49 public Headers getResponseHeaders () { |
|
50 return impl.getResponseHeaders(); |
|
51 } |
|
52 |
|
53 public URI getRequestURI () { |
|
54 return impl.getRequestURI(); |
|
55 } |
|
56 |
|
57 public String getRequestMethod (){ |
|
58 return impl.getRequestMethod(); |
|
59 } |
|
60 |
|
61 public HttpContextImpl getHttpContext (){ |
|
62 return impl.getHttpContext(); |
|
63 } |
|
64 |
|
65 public void close () { |
|
66 impl.close(); |
|
67 } |
|
68 |
|
69 public InputStream getRequestBody () { |
|
70 return impl.getRequestBody(); |
|
71 } |
|
72 |
|
73 public int getResponseCode () { |
|
74 return impl.getResponseCode(); |
|
75 } |
|
76 |
|
77 public OutputStream getResponseBody () { |
|
78 return impl.getResponseBody(); |
|
79 } |
|
80 |
|
81 |
|
82 public void sendResponseHeaders (int rCode, long contentLen) |
|
83 throws IOException |
|
84 { |
|
85 impl.sendResponseHeaders (rCode, contentLen); |
|
86 } |
|
87 |
|
88 public InetSocketAddress getRemoteAddress (){ |
|
89 return impl.getRemoteAddress(); |
|
90 } |
|
91 |
|
92 public InetSocketAddress getLocalAddress (){ |
|
93 return impl.getLocalAddress(); |
|
94 } |
|
95 |
|
96 public String getProtocol (){ |
|
97 return impl.getProtocol(); |
|
98 } |
|
99 |
|
100 public Object getAttribute (String name) { |
|
101 return impl.getAttribute (name); |
|
102 } |
|
103 |
|
104 public void setAttribute (String name, Object value) { |
|
105 impl.setAttribute (name, value); |
|
106 } |
|
107 |
|
108 public void setStreams (InputStream i, OutputStream o) { |
|
109 impl.setStreams (i, o); |
|
110 } |
|
111 |
|
112 public HttpPrincipal getPrincipal () { |
|
113 return impl.getPrincipal(); |
|
114 } |
|
115 |
|
116 ExchangeImpl getExchangeImpl () { |
|
117 return impl; |
|
118 } |
|
119 } |