private void executeCommand( Socket client ){
		try {
			try {
				client.setSoTimeout(30000);
				BufferedReader in = new BufferedReader( new InputStreamReader( client.getInputStream() ) );  
				PrintStream out = new PrintStream( client.getOutputStream() );  
				System.out.println( "I/O setup done" );
				
				String[] tokens = null;
				String line = in.readLine();
//				while ( in.ready() && line != null ) {
				while( line != null ) {
					System.out.println(line);
					if(line.equals("")) break;
					if (getP.matcher(line).matches())
						tokens = line.split("\\s+");
					line = in.readLine();
				}
				System.out.println(line);

				if (tokens != null && tokens.length > 2 && tokens[1].startsWith("/")) {
					if (tokens[1].equals("/"))
						tokens[1] = "index.html";
					else
						tokens[1] = tokens[1].substring(1);
					String type = getFileType(tokens[1]);
					File file = new File(tokens[1]);
					System.out.println(file.getName() + " requested.");
					if (type == null)
						System.out.println("Not supported type");
					else
						sendFile(out, file, type);
				}

				out.flush();
				out.close();
				in.close();
			}finally {
				client.close();
				System.out.println( "A connection is closed." );				
			}
		}
		catch(Exception exception) {
			exception.printStackTrace();
		}
	}