nanohttpd: refactor: remove IHTTPSession.execute()

This commit is contained in:
Haowei Wen 2020-08-26 18:33:12 +08:00
parent 5ca213f5cc
commit 854b0284bd
No known key found for this signature in database
GPG Key ID: 5BC167F73EA558E4
2 changed files with 18 additions and 11 deletions

View File

@ -58,22 +58,30 @@ import java.util.Map;
*/ */
public interface IHTTPSession { public interface IHTTPSession {
void execute() throws IOException; InetSocketAddress getRemoteAddress();
Map<String, String> getHeaders();
InputStream getInputStream() throws IOException;
String getMethod(); String getMethod();
Map<String, List<String>> getParameters();
String getQueryParameterString();
/** /**
* @return the path part of the URL. * @return the path part of the URL.
*/ */
String getUri(); String getUri();
InetSocketAddress getRemoteAddress(); /**
* @return raw query string, null if no query exists
*/
String getQueryParameterString();
/**
* @return decoded query parameters
*/
Map<String, List<String>> getParameters();
Map<String, String> getHeaders();
/**
* @return request body, null if the request does not have a payload
*/
InputStream getInputStream() throws IOException;
} }

View File

@ -257,7 +257,6 @@ public abstract class NanoHTTPD {
} }
@SuppressWarnings("resource") @SuppressWarnings("resource")
@Override
public void execute() throws IOException { public void execute() throws IOException {
Response r = null; Response r = null;
try { try {