// Path: app/src/main/java/my/madet/ntlm/NTLMSchemeFactory.java
// public class NTLMSchemeFactory implements AuthSchemeFactory
// {
//     @Override
//     public AuthScheme newInstance(HttpParams params)
//     {
//         return new NTLMScheme(new JCIFSEngine());
//     }
// }


import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import my.madet.ntlm.NTLMSchemeFactory;
import org.apache.http.HttpResponse;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.NTCredentials;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import android.content.Context;
import android.os.Environment;
import android.util.Log;
		/*
		 * FileWriter fw = new FileWriter(file.getAbsoluteFile());
		 * BufferedWriter bw = new BufferedWriter(fw);
		 */
		byte[] data = str.getBytes();
		try {

			if (!file.exists()) {
				file.createNewFile();
			}

			fos = new FileOutputStream(file);
			fos.write(data);
			fos.flush();
			fos.close();
		} catch (FileNotFoundException e) {
			// handle exception
			Log.e("SaveToSdCard", "File Not found exception");
		} catch (IOException e) {
			// handle exception
			Log.e("SaveToSdCard", "Exception" + e.toString());
		}
	}

	public String FetchUrL(String url) {
		StringBuffer result = new StringBuffer();
		DefaultHttpClient httpclient = new DefaultHttpClient();
		try {
			// register ntlm auth scheme
			httpclient.getAuthSchemes().register("ntlm",
// Path: app/src/main/java/my/madet/ntlm/NTLMSchemeFactory.java
// public class NTLMSchemeFactory implements AuthSchemeFactory
// {
//     @Override
//     public AuthScheme newInstance(HttpParams params)
//     {
//         return new NTLMScheme(new JCIFSEngine());
//     }
// }


// Path: app/src/main/java/my/madet/function/HttpParser.java
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import my.madet.ntlm.NTLMSchemeFactory;
import org.apache.http.HttpResponse;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.NTCredentials;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import android.content.Context;
import android.os.Environment;
import android.util.Log;

		/*
		 * FileWriter fw = new FileWriter(file.getAbsoluteFile());
		 * BufferedWriter bw = new BufferedWriter(fw);
		 */
		byte[] data = str.getBytes();
		try {

			if (!file.exists()) {
				file.createNewFile();
			}

			fos = new FileOutputStream(file);
			fos.write(data);
			fos.flush();
			fos.close();
		} catch (FileNotFoundException e) {
			// handle exception
			Log.e("SaveToSdCard", "File Not found exception");
		} catch (IOException e) {
			// handle exception
			Log.e("SaveToSdCard", "Exception" + e.toString());
		}
	}

	public String FetchUrL(String url) {
		StringBuffer result = new StringBuffer();
		DefaultHttpClient httpclient = new DefaultHttpClient();
		try {
			// register ntlm auth scheme
			httpclient.getAuthSchemes().register("ntlm",
					new NTLMSchemeFactory());