commit | author | age
|
60719c
|
1 |
/* |
U |
2 |
AV-Direktor - Control OMXPlayer on Raspberry Pi via HTTP |
|
3 |
Copyright (C) 2021 Ulrich Hilger |
|
4 |
|
|
5 |
This program is free software: you can redistribute it and/or modify |
|
6 |
it under the terms of the GNU Affero General Public License as |
|
7 |
published by the Free Software Foundation, either version 3 of the |
|
8 |
License, or (at your option) any later version. |
|
9 |
|
|
10 |
This program is distributed in the hope that it will be useful, |
|
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
GNU Affero General Public License for more details. |
|
14 |
|
|
15 |
You should have received a copy of the GNU Affero General Public License |
|
16 |
along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
17 |
*/ |
|
18 |
|
0c8d27
|
19 |
package de.uhilger.avdirektor.handler; |
U |
20 |
|
|
21 |
import com.sun.net.httpserver.HttpExchange; |
cfe367
|
22 |
import de.uhilger.avdirektor.App; |
0c8d27
|
23 |
import java.util.logging.Level; |
U |
24 |
import java.util.logging.Logger; |
|
25 |
|
|
26 |
/** |
|
27 |
* |
|
28 |
* @author ulrich |
|
29 |
*/ |
b5cc80
|
30 |
public class CmdHandler extends AbstractHandler { |
0c8d27
|
31 |
|
U |
32 |
private static final Logger logger = Logger.getLogger(CmdHandler.class.getName()); |
|
33 |
|
cc2a32
|
34 |
public CmdHandler(String cmd) { |
U |
35 |
this.cmd = cmd; |
63b711
|
36 |
} |
U |
37 |
|
|
38 |
protected String process(HttpExchange t, String params) { |
cfe367
|
39 |
String antwort = App.getPlayer().kommando(cmd); |
63b711
|
40 |
logger.log(Level.FINE, antwort); |
U |
41 |
return antwort; |
|
42 |
} |
|
43 |
|
0c8d27
|
44 |
} |