All pastes #744684 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-10-21 18:29 UTC
rendered paste body

	private  void getRequest() throws IOException { 
		String line;
		
		while ((line = readLine(clientIn)) != null ) { // diabazei ka8e grammh tou arxeiou clientIn opou pernane oi aithseis
			if (line.length() == 0)//elenxei an to mhkos ths grammhs einai 0 
				break;
			Request.append(line + "\r\n");
			StringTokenizer st = new StringTokenizer(line);
			while(st.hasMoreTokens()){
			String method=st.nextToken().toUpperCase();
			String url = st.nextToken();
			String version=st.nextToken();
			System.out.println(url);
			getHost(url);
		   }
		}
		Request.append("\r\n");
			}

 private String getHost(String url){
		StringTokenizer st = new StringTokenizer(url,"/:");
	while(st.hasMoreTokens()){
			
			String http = st.nextToken();
			String host =st.nextToken();
			String upoloipa =st.nextToken();
			System.out.println("HOST :"+host);
			}

 }