commit | author | age
|
b16b54
|
1 |
/* |
U |
2 |
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license |
|
3 |
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template |
|
4 |
*/ |
|
5 |
package de.uhilger.calypso.handler; |
|
6 |
|
|
7 |
import com.sun.net.httpserver.HttpExchange; |
|
8 |
import java.io.IOException; |
|
9 |
import java.util.logging.Level; |
|
10 |
import java.util.logging.Logger; |
|
11 |
|
|
12 |
/** |
|
13 |
* |
|
14 |
* @author ulli |
|
15 |
*/ |
|
16 |
public class DBusHandler extends CmdHandler { |
|
17 |
|
|
18 |
public DBusHandler(String cmd) { |
|
19 |
super(cmd); |
|
20 |
} |
|
21 |
|
|
22 |
@Override |
|
23 |
protected String process(HttpExchange t, String params) { |
|
24 |
String antwort;// = null; |
|
25 |
try { |
|
26 |
StringBuilder kommando = new StringBuilder(cmd); |
|
27 |
Process player_process = Runtime.getRuntime().exec(kommando.toString()); |
|
28 |
antwort = "Kommando ausgefuehrt: " + kommando; |
|
29 |
} catch (IOException ex) { |
|
30 |
antwort = "Fehler: " + ex.getMessage(); |
|
31 |
} |
|
32 |
return antwort; |
|
33 |
} |
|
34 |
|
|
35 |
} |