77
88package org .jruby .rack ;
99
10- import org .jruby .rack .ext .Input ;
1110import java .io .IOException ;
1211import java .io .InputStream ;
1312import java .util .Enumeration ;
@@ -27,13 +26,13 @@ public interface RackEnvironment {
2726 * Environment key that retrieves the exception the {@link RackApplication}
2827 * failed with. Useful when dispatching call to an {@link ErrorApplication}.
2928 */
30- final String EXCEPTION = "jruby.rack.exception" ;
31- final String DYNAMIC_REQS_ONLY = "jruby.rack.dynamic.requests.only" ;
29+ String EXCEPTION = "jruby.rack.exception" ;
30+ String DYNAMIC_REQS_ONLY = "jruby.rack.dynamic.requests.only" ;
3231
3332 /**
3433 * @return the associated {@link RackContext} for this environment
3534 */
36- public RackContext getContext ();
35+ RackContext getContext ();
3736
3837 // The following methods are specific to the rack environment
3938
@@ -42,160 +41,120 @@ public interface RackEnvironment {
4241 * @return the input as a stream
4342 * @throws IOException if there's an IO exception
4443 */
45- public InputStream getInput () throws IOException ;
44+ InputStream getInput () throws IOException ;
4645
4746 /**
4847 * For servlet-based environment implementations the script name might be
4948 * constructed as the the (servlet) context path + the servlet path.
5049 * @return the script name ("CGI" style)
5150 */
52- public String getScriptName ();
51+ String getScriptName ();
5352
5453 // The following methods are usually inherited from the servlet request
5554
5655 /**
5756 * @see javax.servlet.http.HttpServletRequest#getPathInfo()
5857 * @return the request path info
5958 */
60- public String getPathInfo ();
59+ String getPathInfo ();
6160
6261 /**
6362 * Request URI should include the query string if available.
6463 * @see javax.servlet.http.HttpServletRequest#getRequestURI()
6564 * @return the request URI
6665 */
67- public String getRequestURI ();
66+ String getRequestURI ();
6867
6968 /**
7069 * @see javax.servlet.http.HttpServletRequest#getAttributeNames()
7170 * @return an enumeration of all attribute names
7271 */
73- public Enumeration <String > getAttributeNames ();
72+ Enumeration <String > getAttributeNames ();
7473
7574 /**
7675 * @see javax.servlet.http.HttpServletRequest#getAttribute(String)
7776 * @param key the attribute key
7877 * @return the attribute value
7978 */
80- public Object getAttribute (String key );
79+ Object getAttribute (String key );
8180
8281 /**
8382 * @see javax.servlet.http.HttpServletRequest#setAttribute(String, Object)
8483 * @param key the key
8584 * @param value the value
8685 */
87- public void setAttribute (String key , Object value );
86+ void setAttribute (String key , Object value );
8887
8988 /**
9089 * @see javax.servlet.http.HttpServletRequest#getHeaderNames()
9190 * @return an enumeration of all header names
9291 */
93- public Enumeration <String > getHeaderNames ();
92+ Enumeration <String > getHeaderNames ();
9493
9594 /**
9695 * @see javax.servlet.http.HttpServletRequest#getHeader(String)
9796 * @param name the header name
9897 * @return the header value
9998 */
100- public String getHeader (String name );
99+ String getHeader (String name );
101100
102101 /**
103102 * @see javax.servlet.http.HttpServletRequest#getScheme()
104103 * @return the request scheme
105104 */
106- public String getScheme ();
105+ String getScheme ();
107106
108107 /**
109108 * @see javax.servlet.http.HttpServletRequest#getContentType()
110109 * @return the content type
111110 */
112- public String getContentType ();
111+ String getContentType ();
113112
114113 /**
115114 * @see javax.servlet.http.HttpServletRequest#getContentLength()
116115 * @return the content length
117116 */
118- public int getContentLength ();
117+ int getContentLength ();
119118
120119 /**
121120 * @see javax.servlet.http.HttpServletRequest#getMethod()
122121 * @return the request method
123122 */
124- public String getMethod ();
123+ String getMethod ();
125124
126125 /**
127126 * @see javax.servlet.http.HttpServletRequest#getQueryString()
128127 * @return the query string
129128 */
130- public String getQueryString ();
129+ String getQueryString ();
131130
132131 /**
133132 * @see javax.servlet.http.HttpServletRequest#getServerName()
134133 * @return the server name
135134 */
136- public String getServerName ();
135+ String getServerName ();
137136
138137 /**
139138 * @see javax.servlet.http.HttpServletRequest#getServerPort()
140139 * @return the server port
141140 */
142- public int getServerPort ();
141+ int getServerPort ();
143142
144143 /**
145144 * @see javax.servlet.ServletRequest#getRemoteHost()
146145 * @return the remote host
147146 */
148- public String getRemoteHost ();
147+ String getRemoteHost ();
149148
150149 /**
151150 * @see javax.servlet.ServletRequest#getRemoteAddr()
152151 * @return the remote address
153152 */
154- public String getRemoteAddr ();
153+ String getRemoteAddr ();
155154
156155 /**
157156 * @see javax.servlet.http.HttpServletRequest#getRemoteUser()
158157 * @return the remote user
159158 */
160- public String getRemoteUser ();
161-
162- /**
163- * {@link RackEnvironment} extension to obtain a rack.input IO.
164- *
165- * NOTE: This interface will most likely get moved onto the (parent)
166- * environment interface directly once the deprecated way of maintaining
167- * backwards compatibility (using jruby/rack/environment.rb) is removed.
168- *
169- * @deprecated Was an internal interface and is no longer used.
170- * @author kares
171- */
172- @ Deprecated
173- interface ToIO {
174-
175- // TODO move to RackEnvironment once jruby/rack/environment.rb removed
176-
177- /**
178- * Convert this environment into a "rack.input" IO.
179- * Replaces the <code>to_io</code> monkey-patch ...
180- * @return rack.input
181- */
182- public Input toIO ();
183-
184- /**
185- * Set the rack.input, this is an optional operation and implementers
186- * might ignore this call silently if they're capable of constructing
187- * the rack.input themselves.
188- * @param io the rack.input instance
189- */
190- void setIO (Input io ) ;
191-
192- }
193-
194- /**
195- * Convert this environment into a "rack.input" IO.
196- * Replaces the <code>to_io</code> monkey-patch ...
197- * @return rack.input
198- */
199- //public Input toIO() ;
200-
159+ String getRemoteUser ();
201160}
0 commit comments