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.StringgetHTMLFile(java.lang.String fileName)Returns a String containing the HTML content of the File identified by the filenameHttpResponsehandleAddTodoItem(java.util.Map<java.lang.String,java.lang.String> body)Handles the HTTP POST requestHttpResponsehandleDeleteFile(HttpRequest request)Handles the Delete HTTP RequestHttpResponsehandlePutFile(HttpRequest request)Handles the Put HTTP RequestMethods 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
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
Handles the Delete HTTP Request- Parameters:
request- HttpRequest- Returns:
- Corrsponding HttpResponse
-
handlePutFile
Handles the Put HTTP Request- Parameters:
request- HttpRequest- Returns:
- Corrsponding HttpResponse
-