File was renamed from src/de/uhilger/calypso/neu/http/ApiHandler.java |
| | |
| | | along with this program. If not, see <https://www.gnu.org/licenses/>. |
| | | */ |
| | | |
| | | package de.uhilger.calypso.neu.http; |
| | | package de.uhilger.calypso.http; |
| | | |
| | | import com.sun.net.httpserver.HttpContext; |
| | | import com.sun.net.httpserver.HttpExchange; |
| | | import de.uhilger.calypso.neu.actor.PlayActor; |
| | | import de.uhilger.calypso.neu.actor.ShellActor; |
| | | import de.uhilger.calypso.neu.actor.StopServerActor; |
| | | import de.uhilger.calypso.actor.PlayActor; |
| | | import de.uhilger.calypso.actor.ShellActor; |
| | | import de.uhilger.calypso.actor.StopServerActor; |
| | | import java.io.IOException; |
| | | import java.io.OutputStream; |
| | | import java.util.Collection; |
| | | import java.util.Map; |
| | | import java.util.logging.Level; |
| | |
| | | |
| | | case SERVER: |
| | | if(elems[SERVERCMD].equals(STOP)) { |
| | | new StopServerActor().run(exchange.getHttpContext()); |
| | | try { |
| | | antwort = "Calypso: Der Server wird angehalten und die App beendet."; |
| | | sendResponse(exchange, antwort); |
| | | new StopServerActor().run(exchange.getHttpContext()); |
| | | } catch (IOException ex) { |
| | | Logger.getLogger(ApiHandler.class.getName()).log(Level.SEVERE, null, ex); |
| | | antwort = "Fehler: " + ex.getLocalizedMessage(); |
| | | } |
| | | } else { |
| | | antwort = elems[SERVERCMD] + " ist ein unbekanntes Serverkommando"; |
| | | } |