@@ -27,13 +27,13 @@ public interface RackEnvironment {
2727 * Environment key that retrieves the exception the {@link RackApplication}
2828 * failed with. Useful when dispatching call to an {@link ErrorApplication}.
2929 */
30- final String EXCEPTION = "jruby.rack.exception" ;
31- final String DYNAMIC_REQS_ONLY = "jruby.rack.dynamic.requests.only" ;
30+ String EXCEPTION = "jruby.rack.exception" ;
31+ String DYNAMIC_REQS_ONLY = "jruby.rack.dynamic.requests.only" ;
3232
3333 /**
3434 * @return the associated {@link RackContext} for this environment
3535 */
36- public RackContext getContext ();
36+ RackContext getContext ();
3737
3838 // The following methods are specific to the rack environment
3939
@@ -42,160 +42,120 @@ public interface RackEnvironment {
4242 * @return the input as a stream
4343 * @throws IOException if there's an IO exception
4444 */
45- public InputStream getInput () throws IOException ;
45+ InputStream getInput () throws IOException ;
4646
4747 /**
4848 * For servlet-based environment implementations the script name might be
4949 * constructed as the the (servlet) context path + the servlet path.
5050 * @return the script name ("CGI" style)
5151 */
52- public String getScriptName ();
52+ String getScriptName ();
5353
5454 // The following methods are usually inherited from the servlet request
5555
5656 /**
5757 * @see javax.servlet.http.HttpServletRequest#getPathInfo()
5858 * @return the request path info
5959 */
60- public String getPathInfo ();
60+ String getPathInfo ();
6161
6262 /**
6363 * Request URI should include the query string if available.
6464 * @see javax.servlet.http.HttpServletRequest#getRequestURI()
6565 * @return the request URI
6666 */
67- public String getRequestURI ();
67+ String getRequestURI ();
6868
6969 /**
7070 * @see javax.servlet.http.HttpServletRequest#getAttributeNames()
7171 * @return an enumeration of all attribute names
7272 */
73- public Enumeration <String > getAttributeNames ();
73+ Enumeration <String > getAttributeNames ();
7474
7575 /**
7676 * @see javax.servlet.http.HttpServletRequest#getAttribute(String)
7777 * @param key the attribute key
7878 * @return the attribute value
7979 */
80- public Object getAttribute (String key );
80+ Object getAttribute (String key );
8181
8282 /**
8383 * @see javax.servlet.http.HttpServletRequest#setAttribute(String, Object)
8484 * @param key the key
8585 * @param value the value
8686 */
87- public void setAttribute (String key , Object value );
87+ void setAttribute (String key , Object value );
8888
8989 /**
9090 * @see javax.servlet.http.HttpServletRequest#getHeaderNames()
9191 * @return an enumeration of all header names
9292 */
93- public Enumeration <String > getHeaderNames ();
93+ Enumeration <String > getHeaderNames ();
9494
9595 /**
9696 * @see javax.servlet.http.HttpServletRequest#getHeader(String)
9797 * @param name the header name
9898 * @return the header value
9999 */
100- public String getHeader (String name );
100+ String getHeader (String name );
101101
102102 /**
103103 * @see javax.servlet.http.HttpServletRequest#getScheme()
104104 * @return the request scheme
105105 */
106- public String getScheme ();
106+ String getScheme ();
107107
108108 /**
109109 * @see javax.servlet.http.HttpServletRequest#getContentType()
110110 * @return the content type
111111 */
112- public String getContentType ();
112+ String getContentType ();
113113
114114 /**
115115 * @see javax.servlet.http.HttpServletRequest#getContentLength()
116116 * @return the content length
117117 */
118- public int getContentLength ();
118+ int getContentLength ();
119119
120120 /**
121121 * @see javax.servlet.http.HttpServletRequest#getMethod()
122122 * @return the request method
123123 */
124- public String getMethod ();
124+ String getMethod ();
125125
126126 /**
127127 * @see javax.servlet.http.HttpServletRequest#getQueryString()
128128 * @return the query string
129129 */
130- public String getQueryString ();
130+ String getQueryString ();
131131
132132 /**
133133 * @see javax.servlet.http.HttpServletRequest#getServerName()
134134 * @return the server name
135135 */
136- public String getServerName ();
136+ String getServerName ();
137137
138138 /**
139139 * @see javax.servlet.http.HttpServletRequest#getServerPort()
140140 * @return the server port
141141 */
142- public int getServerPort ();
142+ int getServerPort ();
143143
144144 /**
145145 * @see javax.servlet.ServletRequest#getRemoteHost()
146146 * @return the remote host
147147 */
148- public String getRemoteHost ();
148+ String getRemoteHost ();
149149
150150 /**
151151 * @see javax.servlet.ServletRequest#getRemoteAddr()
152152 * @return the remote address
153153 */
154- public String getRemoteAddr ();
154+ String getRemoteAddr ();
155155
156156 /**
157157 * @see javax.servlet.http.HttpServletRequest#getRemoteUser()
158158 * @return the remote user
159159 */
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-
160+ String getRemoteUser ();
201161}
0 commit comments