Moved SimpleAutoResponder#setPort & SimpleAutoResponder#getPort to the bottom of the file

This commit is contained in:
mathias 2021-10-01 18:24:12 +02:00
parent 578ac9e5e9
commit 5b7e4e3de0
No known key found for this signature in database
GPG Key ID: 8950DF62139C852A

View File

@ -12,6 +12,19 @@ public class SimpleAutoResponder {
private int port = 8025;
/**
* Starts the auto responder server
*
* @throws ResponderException Throws whenever the webserver could not start
*/
public void start() throws ResponderException {
try {
httpServer = HttpServer.create(new InetSocketAddress(port), 0);
} catch (IOException e) {
throw new ResponderException("Could not open a webserver under the port " + port + ": " + e.getMessage());
}
}
/**
* Gets the port of the webserver
*
@ -32,17 +45,4 @@ public class SimpleAutoResponder {
return this;
}
/**
* Starts the auto responder server
*
* @throws ResponderException Throws whenever the webserver could not start
*/
public void start() throws ResponderException {
try {
httpServer = HttpServer.create(new InetSocketAddress(port), 0);
} catch (IOException e) {
throw new ResponderException("Could not open a webserver under the port " + port + ": " + e.getMessage());
}
}
}