package pkg.crawler.main; import java.io.IOException; import java.io.ObjectOutputStream; import java.net.Socket; import java.net.UnknownHostException; import javax.mail.MessagingException; import pkg.crawler.data.conn.Crawler; public class Main { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub if (args == null || args.length != 4){ System.out.println("Uso:\n" + "java -jar crawler.jar [imap_host] [imap_admin_password] " + "[imap_user_folder] [http_solr_host_address] \n" + "imap_host - O endereço que está instalado o Expresso Ex: \"127.1.1.1\"\n" + "imap_admin_password - Senha do usuário 'expresso-admin' Ex: \"admin123\"\n" + "http_solr_host_address - Endereço do servidor do Solr Ex: \"http://127.1.1.1:8983/solr/\"\n" + " "); System.exit(0); } // String host, String user, String password, String imapFINBOXAux, String hostSolr //O endereço que está instalado o Expresso Ex: "127.1.1.1" String host = args[0]; //Pasta do usuário do IMAP String imapFINBOXAux = args[1]; //Senha do usuário 'expresso-admin' Ex: "admin123" String password = args[2]; //Endereço do servidor do Solr Ex: "http://127.1.1.1:8983/solr/" String hostSolr = args[3]; try { Crawler crawler = new Crawler(host, "expresso-admin", password, imapFINBOXAux, hostSolr); crawler.run(); } catch (MessagingException e) { // TODO Auto-generated catch block Socket client = null; ObjectOutputStream oos = null; try { client = new Socket("127.1.1.1", 8090); oos = new ObjectOutputStream(client.getOutputStream()); oos.writeObject(imapFINBOXAux); oos.close(); client.close(); } catch (UnknownHostException ee) { e.printStackTrace(); } catch (IOException ee) { e.printStackTrace(); } e.printStackTrace(); } } }