// Path: src/com/jskaleel/fte/common/PrintLog.java
// public class PrintLog {
// 
// 	public static void debug(String TAG,String str) {
// 		if(str.length() > 4000) 
// 		{
// 			Log.d("FTE",TAG+"  ---> " + str.substring(0, 4000));
// 			debug(TAG,str.substring(4000));
// 		} else
// 		{
// 			Log.d("FTE",TAG+ " ---->" +str);
// 		}
// 	}
// 	public static void error(String TAG,String str) {
// 		if(str.length() > 4000) 
// 		{
// 			Log.e("FTE",TAG +"  ---> " + str.substring(0, 4000));
// 			error(TAG,str.substring(4000));
// 		}
// 		else
// 		{
// 			Log.e("FTE",TAG+ " ---->" +str);
// 		}
// 	}
// 	
// }


import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import com.jskaleel.fte.common.PrintLog;

package com.jskaleel.http;



public class HttpGetUrlConnection {

	public HttpGetUrlConnection(){

	}

	public static String getContentFromUrl(String api_url) throws UnsupportedEncodingException{
		HttpURLConnection conn = null;
		StringBuilder jsonResults = new StringBuilder();
		UrlResponse response = new UrlResponse();
		String content = null;

		try {
						
			StringBuilder sb = new StringBuilder(api_url);

			HttpURLConnection.setFollowRedirects(true);

			URL url = new URL(sb.toString());
			conn = (HttpURLConnection) url.openConnection();
			conn.setRequestMethod("GET");


			InputStreamReader in = new InputStreamReader(conn.getInputStream());	        
			int statusCode = conn.getResponseCode();

			int read;
			char[] buff = new char[1024];
			while ((read = in.read(buff)) != -1) {
				jsonResults.append(buff, 0, read);
			}	

			content = jsonResults.toString();

			response = HttpUtils.getResponse(statusCode, content);
			

// Path: src/com/jskaleel/fte/common/PrintLog.java
// public class PrintLog {
// 
// 	public static void debug(String TAG,String str) {
// 		if(str.length() > 4000) 
// 		{
// 			Log.d("FTE",TAG+"  ---> " + str.substring(0, 4000));
// 			debug(TAG,str.substring(4000));
// 		} else
// 		{
// 			Log.d("FTE",TAG+ " ---->" +str);
// 		}
// 	}
// 	public static void error(String TAG,String str) {
// 		if(str.length() > 4000) 
// 		{
// 			Log.e("FTE",TAG +"  ---> " + str.substring(0, 4000));
// 			error(TAG,str.substring(4000));
// 		}
// 		else
// 		{
// 			Log.e("FTE",TAG+ " ---->" +str);
// 		}
// 	}
// 	
// }


// Path: src/com/jskaleel/http/HttpGetUrlConnection.java
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import com.jskaleel.fte.common.PrintLog;

package com.jskaleel.http;



public class HttpGetUrlConnection {

	public HttpGetUrlConnection(){

	}

	public static String getContentFromUrl(String api_url) throws UnsupportedEncodingException{
		HttpURLConnection conn = null;
		StringBuilder jsonResults = new StringBuilder();
		UrlResponse response = new UrlResponse();
		String content = null;

		try {
						
			StringBuilder sb = new StringBuilder(api_url);

			HttpURLConnection.setFollowRedirects(true);

			URL url = new URL(sb.toString());
			conn = (HttpURLConnection) url.openConnection();
			conn.setRequestMethod("GET");


			InputStreamReader in = new InputStreamReader(conn.getInputStream());	        
			int statusCode = conn.getResponseCode();

			int read;
			char[] buff = new char[1024];
			while ((read = in.read(buff)) != -1) {
				jsonResults.append(buff, 0, read);
			}	

			content = jsonResults.toString();

			response = HttpUtils.getResponse(statusCode, content);
			

			PrintLog.debug("HttpGerUrl", "Response: "+content);
