Package http.server

Class Service

java.lang.Object
http.server.Service

public class Service
extends java.lang.Object
  • Constructor Summary

    Constructors
    Constructor Description
    Service()  
  • Method Summary

    Modifier and Type Method Description
    static java.lang.String getHTMLFile​(java.lang.String fileName)
    Returns a String containing the HTML content of the File identified by the filename
    HttpResponse handleAddTodoItem​(java.util.Map<java.lang.String,​java.lang.String> body)
    Handles the HTTP POST request
    HttpResponse handleDeleteFile​(HttpRequest request)
    Handles the Delete HTTP Request
    HttpResponse handlePutFile​(HttpRequest request)
    Handles the Put HTTP Request

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Service

      public Service()
  • Method Details

    • handleAddTodoItem

      public HttpResponse handleAddTodoItem​(java.util.Map<java.lang.String,​java.lang.String> body)
      Handles the HTTP POST request
      Parameters:
      body - Map containing the body of the request.
      Returns:
      corresponding HttpResponse
    • getHTMLFile

      public static java.lang.String getHTMLFile​(java.lang.String fileName)
      Returns a String containing the HTML content of the File identified by the filename
      Parameters:
      fileName - String identifying the researched File
      Returns:
      String containing the HTML content of the File identified by the filename
    • handleDeleteFile

      public HttpResponse handleDeleteFile​(HttpRequest request)
      Handles the Delete HTTP Request
      Parameters:
      request - HttpRequest
      Returns:
      Corrsponding HttpResponse
    • handlePutFile

      public HttpResponse handlePutFile​(HttpRequest request)
      Handles the Put HTTP Request
      Parameters:
      request - HttpRequest
      Returns:
      Corrsponding HttpResponse