Package server

Class GetImageHandler

java.lang.Object
server.GetImageHandler
All Implemented Interfaces:
HttpHandler

public class GetImageHandler extends Object implements HttpHandler
This http handler class handles the joining/connecting to a chat room.
  • Constructor Details

    • GetImageHandler

      public GetImageHandler(DatabaseHandler databaseHandler)
      Constructor
  • Method Details

    • handle

      public void handle(HttpExchange httpexchange) throws IOException
      This handles the http get_image request. Will respond with statuscodes
      -200 OK
      -400 Bad Request, if an exception was raised while accessing the file
      -405 Method Not Allowed, if POST request method was not used
      Test with "curl http://fjenhh.me:2345/get_image/{imagename}"
      Specified by:
      handle in interface HttpHandler
      Parameters:
      httpexchange - http exchange to be handled by the function
      Throws:
      IOException