1 |
package dk.thoerup.bukkit.hoeruputils.web; |
package dk.thoerup.bukkit.hoeruputils.web; |
2 |
|
|
3 |
import java.io.IOException; |
import java.io.IOException; |
4 |
|
import java.io.OutputStream; |
5 |
|
import java.net.HttpURLConnection; |
6 |
import java.text.SimpleDateFormat; |
import java.text.SimpleDateFormat; |
7 |
import java.util.Date; |
import java.util.Date; |
8 |
|
|
58 |
} |
} |
59 |
} |
} |
60 |
|
|
61 |
|
byte bytes[] = text.getBytes(); |
62 |
http.getResponseBody().write( text.getBytes() ); |
http.sendResponseHeaders(HttpURLConnection.HTTP_OK, bytes.length ); |
63 |
|
final OutputStream os = http.getResponseBody(); |
64 |
|
os.write(bytes); |
65 |
|
os.close(); |
66 |
|
|
67 |
} |
} |
68 |
|
|
69 |
private String buildText() { |
private String buildText() { |