| | |
| | | * |
| | | * @author ulrich |
| | | */ |
| | | public class StopServerHandler implements HttpHandler { |
| | | public class StopServerHandler extends OMXPlayer implements HttpHandler { |
| | | |
| | | @Override |
| | | public void handle(HttpExchange exchange) throws IOException { |
| | | Logger.getLogger(StopServerHandler.class.getName()).info(exchange.getRequestURI().toString()); |
| | | this.kommando(CMD_STOP); |
| | | String response = "Server stopped"; |
| | | exchange.sendResponseHeaders(200, response.length()); |
| | | OutputStream os = exchange.getResponseBody(); |
| | | os.write(response.getBytes()); |
| | | os.flush(); |
| | | os.close(); |
| | | Logger.getLogger(StopServerHandler.class.getName()).info("stopping app."); |
| | | App.stop(); |