Basisklassen zum Modul jdk.httpserver
ulrich
2021-06-24 bf550a92498fc5f253ffa0daefa03022d0a39724
src/de/uhilger/httpserver/base/HttpResponder.java
@@ -130,13 +130,7 @@
   * @throws IOException falls etwas schief geht entsteht dieser Fehler
   */
  public void sendNotFound(HttpExchange e, String fname) throws IOException {
    OutputStream os = e.getResponseBody();
    String response = fname + STR_NOT_FOUND;
    byte[] bytes = response.getBytes(StandardCharsets.UTF_8);
    e.sendResponseHeaders(SC_NOT_FOUND, bytes.length);
    os.write(bytes);
    os.flush();
    os.close();
    antwortSenden(e, SC_NOT_FOUND, fname + STR_NOT_FOUND);
  }  
  public void antwortSenden(HttpExchange exchange, int code, String antwort) throws IOException {