Refactor response generation and xmls

This commit is contained in:
Dominik Adam Przybysz 2014-12-13 21:49:24 +01:00
parent ba63d36fa0
commit 0bfa0d91b4
8 changed files with 50 additions and 36 deletions

View file

@ -0,0 +1,13 @@
package pl.touk.mockserver.server
import com.sun.net.httpserver.HttpExchange
class Util {
static void createResponse(HttpExchange ex, String response, int statusCode) {
ex.sendResponseHeaders(statusCode, response ? response.length() : -1)
if (response) {
ex.responseBody << response
ex.responseBody.close()
}
}
}