public void sendResponse() throws IOException {
		byte[] bytes = new byte[HTTPSettings.BUFFER_SIZE];
		FileInputStream fis = null;
		String fileName = request.getUri();

		try {		
			File file = new File(HTTPSettings.DOC_ROOT, fileName);
			String contentType = null;
			Integer statusCode = 0;		
			
			if(file.exists()) {
				String fileType = getFileType(fileName);
				contentType = HTTPSettings.dataTypes.get(fileType.toUpperCase());
				
				if(contentType != null) {
					statusCode = 200;
				} else {
					file = new File(HTTPSettings.INTERAL_SERVER_ERROR);
					contentType = HTTPSettings.dataTypes.get("HTML");
					statusCode = 500;
				}
			} else {
				file = new File(HTTPSettings.FILE_NOT_FOUND);
				contentType = HTTPSettings.dataTypes.get("HTML");
				statusCode = 404;
			}		
			
			// WRITE HTTP HEADER TO BROWSER
			byte[] header = getHTTPHeader(file, contentType, statusCode);
			out.write(header);
			
			// READ FILE AND WRITE IT TO BROWSER			
			FileInputStream inputStream = getInputStream (file);				
			int ch = inputStream.read(bytes, 0, HTTPSettings.BUFFER_SIZE);
			while (ch != -1) {
				out.write(bytes, 0, ch);
				ch = inputStream.read(bytes, 0, HTTPSettings.BUFFER_SIZE);
			}		
			out.flush();
			out.close();

		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			if (fis != null)
				fis.close();
		}
	}