private HttpResponse createResponse(HttpMessage message) throws IOException {

        String resourcePath = ROOT_WEBSITE_DIR + message.getHeader().getLocation();
        HttpResponse.HttpResponseCode responseCode = HttpResponse.HttpResponseCode.NOT_FOUND;
        ReadOnlyResource resource = null;

        if(resourcePath.contains("..")){
            return new HttpResponse(new HttpMessage(), responseCode);
        }

        if(resourceManager.exists(resourcePath)){
            resource = resourceManager.getFile(resourcePath);
        }
        else if(resourcePath.equals(ROOT_WEBSITE_DIR + "/")){
            resource = resourceManager.getFile(ROOT_WEBSITE_DIR + "/index.html");
        }
        else if(resourceManager.exists(resourcePath + ".html")){
            resource = resourceManager.getFile(resourcePath + ".html");
        }
        else if(!resourceManager.exists(resourcePath)){

            if(resourceManager.exists(ROOT_WEBSITE_DIR + "/404.html")) {
                resource = resourceManager.getFile(ROOT_WEBSITE_DIR + "/404.html");
            }
        }

        HttpMessage newMessage = new HttpMessage();
        if(resource != null){
            newMessage = new HttpMessage(resource.read());
            responseCode = HttpResponse.HttpResponseCode.OK;
        }

        return new HttpResponse(newMessage, responseCode);
    }