@SuppressWarnings("deprecation")
	@Override
	public void run() {
		
		log.fine("Connection Handler " + Thread.currentThread().getId() +": Started Connection " + socket.getInetAddress().getHostName() + ":" + socket.getPort());
		try {
			
			
			RequestHandler rhandler = new RequestHandler();
			ImageHandler imgHandler = new ImageHandler(in, out);
			String line = in.readLine();
			if(line != null) {
				if((line.indexOf("GET") == 0) || (line.indexOf("POST") == 0)) {
					imgHandler.handle(line);
				} else {
					out.write((rhandler.request(line) + "\n").getBytes("US-ASCII"));
				}
			}

			out.flush();

			socket.close();

			
		} catch (IOException e) {
			log.log(Level.SEVERE, "Connection Handler: ", e);
			
			e.printStackTrace();
		}
		
		log.fine("Connection Handler " + Thread.currentThread().getId() +": Closed Connection " + socket.getInetAddress().getHostName() + ":" + socket.getPort());
		
		
		
	}