import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.net.MalformedURLException;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.methods.GetMethod;
import org.ita.capes.pegarIefs.ControleProcessamento;
import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
public class PrincipalBaixaIefsDoSite {
public static void main(String args[]){
ControleProcessamento cp = new ControleProcessamento ("NotNecessaryDir", "", "D:\\Iefs\\",4000);
cp.baixarIefs();
/*
String myDir = "D:\\Iefs";
File f, f1;
String baseUrl="http://www.educacaosuperior.inep.gov.br/funcional/info_ies_new.asp?pIES=";
HttpClient hc = new HttpClient();
GetMethod method = new GetMethod(baseUrl+1000);
byte[] responseBody;
String resposta;
f1 = new File (myDir);
f1.mkdir();
try {
hc.executeMethod(method);
responseBody = method.getResponseBody();
resposta = new String(responseBody);
System.out.println(resposta);
f = new File(myDir+"\\" +1000+".txt");
FileWriter fw = new FileWriter (f);
BufferedWriter out = new BufferedWriter( fw );
out.write(resposta);
out.close();
fw.close();
} catch (HttpException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
*/
/*
try {
f = new File("C:\\Users\\Einstein\\workspace\\TG6_Parse\\src\\exemplo.html");
FileReader fr = new FileReader (f);
BufferedReader in = new BufferedReader( fr );
String line;
while ((line = in.readLine()) !=null) str+=line + "\n";
}
catch ( FileNotFoundException e ) {
System.out.println( "File Disappeared" );
} catch (IOException e) {
e.printStackTrace();
}
System.out.println(str);
*/
}
}