| | |
| | | */ |
| | | package de.uhilger.mediaz.api; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.sun.net.httpserver.HttpExchange; |
| | | import com.sun.net.httpserver.HttpHandler; |
| | | import java.io.BufferedReader; |
| | |
| | | import java.io.InputStream; |
| | | import java.io.InputStreamReader; |
| | | import java.io.OutputStream; |
| | | import java.util.logging.Level; |
| | | import java.util.logging.Logger; |
| | | |
| | | |
| | |
| | | } |
| | | break; |
| | | } |
| | | logger.fine(response); |
| | | e.sendResponseHeaders(code, response.length()); |
| | | OutputStream os = e.getResponseBody(); |
| | | os.write(response.getBytes()); |
| | |
| | | } |
| | | r.close(); |
| | | String json = sb.toString(); |
| | | logger.log(Level.FINE, "json: {0}", json); |
| | | return json; |
| | | } |
| | | |