public void clientHttp()
	{
		BufferedReader in = null;
		try {
			
			ListIterator<SearchHitMessage> it = Simpella.searchHitMsgList.listIterator();
			String ipToConnect="";
			String portToConnect="";
			String fileName="";
			String fileIndex="";
			int flag = 0;
			while(it.hasNext()) {
				SearchHitMessage shm = it.next();
				ListIterator<FileDetails> lit = shm.fDetails.listIterator();
				while(lit.hasNext()) {
					FileDetails fd = lit.next();
					if(fd.index == index) {
						flag = 1;
						ipToConnect = shm.msgFromIp;
						portToConnect = String.valueOf(shm.msgFromPort);
						fileName = fd.fileName;
						fileIndex = String.valueOf(fd.fileIndex);
						
					}
				}
			}
			if(flag == 1) {
				URL url = new URL("http://"+ipToConnect+":"+portToConnect+"/get/"+fileIndex+"/"+fileName);
				HttpURLConnection connection = (HttpURLConnection)url.openConnection(); 
				connection.setRequestMethod("GET");
				connection.setRequestProperty("User-Agent", " Simpella 0.6");
				connection.setRequestProperty("Range"," bytes=0-");
				in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
				String s = in.readLine();
				String res = s;
				//System.out.println(s);
				while(in.ready()) {
					s = in.readLine();
					res = res+s;
					//System.out.println(s);
					if(s.trim().isEmpty())
						break;
				}
				
				String temp = res.substring(res.indexOf("Content-length"),res.indexOf("Connection"));
				//System.out.println("temp is "+temp);
				String contentLength = temp.substring(temp.indexOf(": ")+2);
				//System.out.println("content Length is "+contentLength);
				int conLength = Integer.parseInt(contentLength);
				if(!res.contains("503 File not found"))
					httpProtocol(connection, fileName,ipToConnect,portToConnect,conLength);
				else if(res.contains("503 File not found"))
					System.out.println("File not Found: Try Again");
				in.close();
			}else {
				System.out.println("Error: Index Incorrect");
			}		
			
		}catch(IOException e) {
				System.out.println("Connection not possible at this point..try again");
			}
		
		
		
	}