41 |
|
|
42 |
@Override |
@Override |
43 |
public void handle(HttpExchange http) throws IOException { |
public void handle(HttpExchange http) throws IOException { |
|
/* if(!event.path[0].equalsIgnoreCase("webstatus")) { |
|
|
return; |
|
|
}*/ |
|
44 |
|
|
45 |
String text; |
String text; |
46 |
|
|
56 |
} |
} |
57 |
|
|
58 |
byte bytes[] = text.getBytes(); |
byte bytes[] = text.getBytes(); |
59 |
|
http.getResponseHeaders().add("Content-Type", "text/plain"); |
60 |
http.sendResponseHeaders(HttpURLConnection.HTTP_OK, bytes.length ); |
http.sendResponseHeaders(HttpURLConnection.HTTP_OK, bytes.length ); |
61 |
final OutputStream os = http.getResponseBody(); |
final OutputStream os = http.getResponseBody(); |
62 |
os.write(bytes); |
os.write(bytes); |
63 |
os.close(); |
os.close(); |
64 |
|
http.close(); |
65 |
|
|
66 |
} |
} |
67 |
|
|