--- /dev/null
+package com.company;
+
+import java.io.*;
+import java.nio.file.Path;
+import java.nio.file.StandardWatchEventKinds;
+import java.nio.file.WatchEvent;
+import java.nio.file.WatchEvent.Kind;
+import java.nio.file.WatchKey;
+import java.nio.file.WatchService;
+import java.security.NoSuchAlgorithmException;
+import java.sql.SQLException;
+import java.util.ArrayList;
+
+// Simple class to watch directory events.
+class DirectoryWatcher implements Runnable {
+
+ private Path path;
+
+ public DirectoryWatcher(Path path) {
+ this.path = path;
+ }
+
+ //rimuove tutti gli elementi non validi
+ private void pulisciCartella() {
+ File dir = new File(global.locationEsercizi);
+ String[] lista=dir.list();
+ for(String name : lista)
+ {
+ if (!EsNameParser.check(name))
+ {
+ File file = new File(global.locationEsercizi+name);
+ if (file.delete())
+ System.out.println("eliminato: "+name);
+ else
+ System.out.println("problema di eliminazione file");
+ }
+ else
+ {
+ xmlOperation es=new xmlOperation();
+ File car=new File(global.listaEsercizi);
+ if (car.exists()) {
+ dbConnect db=new dbConnect();
+ try {
+ ArrayList<String> esercizi=suString.stringToArrayList(db.dbQuery("4"));
+ boolean add=true;
+ for(String esercizio : esercizi)
+ {
+ if(esercizio.equals(name))
+ add=false;
+ }
+ if(add)
+ es.add(name);
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InstantiationException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ } catch (NoSuchAlgorithmException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+ }
+
+ // print the events and the affected file
+ private void printEvent(WatchEvent<?> event) throws IOException {
+ Kind<?> kind = event.kind();
+ if (kind.equals(StandardWatchEventKinds.ENTRY_CREATE))
+ {
+ Path pathCreated = (Path) event.context();
+ System.out.println("Entry created:" + pathCreated);
+ boolean check = EsNameParser.check(pathCreated.getFileName().toString());
+ if(!check)
+ {
+ File file = new File(global.locationEsercizi+pathCreated.getFileName().toString());
+ if(file.delete())
+ System.out.println("eliminato");
+ else
+ System.out.println("problema di eliminazione file");
+ }
+ else
+ {
+ xmlOperation es=new xmlOperation();
+ File dir=new File(global.listaEsercizi);
+ if (dir.exists())
+ es.add(pathCreated.getFileName().toString());
+ }
+ }
+ else if (kind.equals(StandardWatchEventKinds.ENTRY_DELETE))
+ {
+ Path pathDeleted = (Path) event.context();
+ System.out.println("Entry deleted:" + pathDeleted);
+ xmlOperation es=new xmlOperation();
+ File dir=new File(global.listaEsercizi);
+ if (dir.exists())
+ es.remove(pathDeleted.getFileName().toString());
+ }
+ else if (kind.equals(StandardWatchEventKinds.ENTRY_MODIFY))
+ {
+ Path pathModified = (Path) event.context();
+ System.out.println("Entry modified:" + pathModified);
+ }
+ }
+
+ @Override
+ public void run() {
+ try {
+ pulisciCartella();
+ WatchService watchService = path.getFileSystem().newWatchService();
+ path.register(watchService, StandardWatchEventKinds.ENTRY_CREATE,
+ StandardWatchEventKinds.ENTRY_MODIFY, StandardWatchEventKinds.ENTRY_DELETE);
+
+ // loop forever to watch directory
+ while (true) {
+ WatchKey watchKey;
+ watchKey = watchService.take(); // this call is blocking until events are present
+
+ // poll for file system events on the WatchKey
+ for (final WatchEvent<?> event : watchKey.pollEvents()) {
+ printEvent(event);
+ }
+
+ // if the watched directed gets deleted, get out of run method
+ if (!watchKey.reset()) {
+ System.out.println("No longer valid");
+ watchKey.cancel();
+ watchService.close();
+ break;
+ }
+ }
+
+ } catch (InterruptedException ex) {
+ System.out.println("interrupted. Goodbye");
+ return;
+ } catch (IOException ex) {
+ ex.printStackTrace(); // don't do this in production code. Use a loggin framework
+ return;
+ }
+ }
+
+}
--- /dev/null
+package com.company;
+
+import java.util.Date;
+import java.util.Properties;
+import javax.mail.Message;
+import javax.mail.MessagingException;
+import javax.mail.Multipart;
+import javax.mail.NoSuchProviderException;
+import javax.mail.Session;
+import javax.mail.Transport;
+import javax.mail.internet.AddressException;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeBodyPart;
+import javax.mail.internet.MimeMessage;
+import javax.mail.internet.MimeMultipart;
+
+
+
+public class EmailSender {
+ private String user;
+ private String password;
+ private String host;
+ private String mittente;
+ private String destinatario;
+ private String oggetto;
+ private String mess;
+
+
+ EmailSender(String user, String password, String host,
+ String mittente, String destinatario,
+ String oggetto, String mess){
+
+ this.user = user;
+ this.password = password;
+ this.host = host;
+ this.mittente = mittente;
+ this.destinatario = destinatario;
+ this.oggetto = oggetto;
+ this.mess=mess;
+ }
+
+
+ // Metodo che si occupa dell'invio effettivo della mail
+ public void inviaEmail() {
+ int port = 465; //porta 25 per non usare SSL
+
+ Properties props = new Properties();
+ props.put("mail.smtp.auth", "true");
+ props.put("mail.smtp.user", mittente);
+ props.put("mail.smtp.host", host);
+ props.put("mail.smtp.port", port);
+
+ // commentare la riga seguente per non usare SSL
+ props.put("mail.smtp.starttls.enable","true");
+ props.put("mail.smtp.socketFactory.port", port);
+
+ // commentare la riga seguente per non usare SSL
+ props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
+ props.put("mail.smtp.socketFactory.fallback", "false");
+
+ Session session = Session.getInstance(props, null);
+ session.setDebug(true);
+
+ // Creazione delle BodyParts del messaggio
+ MimeBodyPart messageBodyPart1 = new MimeBodyPart();
+
+ try{
+ // COSTRUZIONE DEL MESSAGGIO
+ Multipart multipart = new MimeMultipart();
+ MimeMessage msg = new MimeMessage(session);
+
+ // header del messaggio
+ msg.setSubject(oggetto);
+ msg.setSentDate(new Date());
+ msg.setFrom(new InternetAddress(mittente));
+
+ // destinatario
+ msg.addRecipient(Message.RecipientType.TO,
+ new InternetAddress(destinatario));
+
+ // corpo del messaggio
+ messageBodyPart1.setText(mess);
+ multipart.addBodyPart(messageBodyPart1);
+
+ // allegato al messaggio
+ /*DataSource source = new FileDataSource(allegato);
+ messageBodyPart2.setDataHandler(new DataHandler(source));
+ messageBodyPart2.setFileName(allegato);
+ multipart.addBodyPart(messageBodyPart2);*/
+
+ // inserimento delle parti nel messaggio
+ msg.setContent(multipart);
+
+ Transport transport = session.getTransport("smtps"); //("smtp") per non usare SSL
+ transport.connect(host, user, password);
+ transport.sendMessage(msg, msg.getAllRecipients());
+ transport.close();
+
+ System.out.println("Invio dell'email Terminato");
+
+ }catch(AddressException ae) {
+ ae.printStackTrace();
+ }catch(NoSuchProviderException nspe){
+ nspe.printStackTrace();
+ }catch(MessagingException me){
+ me.printStackTrace();
+ }
+
+ }
+}
--- /dev/null
+package com.company;
+
+import java.io.File;
+import java.io.FileInputStream;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathFactory;
+
+import org.w3c.dom.Document;
+
+import java.lang.Integer;
+import java.io.FileReader;
+import java.io.BufferedReader;
+
+public class EsNameParser {
+ EsNameParser(){}
+
+ static public String esName()
+ {
+ try {
+ FileInputStream file = new FileInputStream(new File(global.listaEsercizi));
+ DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder builder = builderFactory.newDocumentBuilder();
+ Document xmlDocument = builder.parse(file);
+ XPath xPath = XPathFactory.newInstance().newXPath();
+ int esNumber = Integer.parseInt(xPath.compile("count(/esercizi/esercizio)").evaluate(xmlDocument));
+ String returnValue = null;
+ for (int i = 1; i <= esNumber; i++) {
+ String name = xPath.compile("/esercizi/esercizio[" + i + "]").evaluate(xmlDocument);
+ if (name == null || name.isEmpty())
+ continue;
+ else {
+ if(returnValue==null)
+ returnValue=name;
+ else
+ returnValue = returnValue + "/" + name;
+ }
+ }
+ file.close();
+ return returnValue;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public static boolean check(String esercizio)
+ {
+ boolean value=false;
+ try
+ {
+ String cartellaEs=global.locationEsercizi;
+
+ BufferedReader br = new BufferedReader(new FileReader(cartellaEs+esercizio));
+ if (br.readLine() == null) {
+ br.close();
+ return false;
+ }
+ FileInputStream file = new FileInputStream(new File(cartellaEs+"/"+esercizio));
+ DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder builder = builderFactory.newDocumentBuilder();
+ Document xmlDocument = builder.parse(file);
+ value=checkFormula(xmlDocument,"/esercizio/tesi/formula[1]");
+ if(value)
+ value=checkIpotesi(xmlDocument);
+ file.close();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return value;
+ }
+
+ static public boolean checkFormula(Document xmlDocument, String position) {
+ try
+ {
+ XPath xPath = XPathFactory.newInstance().newXPath();
+ if(Integer.parseInt(xPath.compile("count(" + position + ")").evaluate(xmlDocument))==1) {
+ String type = xPath.compile(position + "/@type").evaluate(xmlDocument);
+ int numbOfElements = 5;
+ if (type.contentEquals("and") || type.contentEquals("or") || type.contentEquals("impl"))
+ numbOfElements = 2;
+ else if (type.contentEquals("not"))
+ numbOfElements = 1;
+ else if (type.contentEquals("literal") || type.contentEquals("atomic"))
+ numbOfElements = 0;
+ int count = Integer.parseInt(xPath.compile("count(" + position + "/formula)").evaluate(xmlDocument));
+ if (count == numbOfElements) {
+ if (numbOfElements == 2) {
+ boolean firstChild = checkFormula(xmlDocument, position + "/formula[1]");
+ boolean secondChild = checkFormula(xmlDocument, position + "/formula[2]");
+ if (!firstChild || !secondChild)
+ return false;
+ else
+ return true;
+ }
+ else if (numbOfElements == 1)
+ {
+ boolean child = checkFormula(xmlDocument, position + "/formula[1]");
+ if (!child)
+ return false;
+ return true;
+ }
+ else if (numbOfElements == 0)
+ {
+ String child = xPath.compile(position).evaluate(xmlDocument);
+ if (child == null || child.isEmpty())
+ return false;
+ else
+ return true;
+ }
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return false;
+ }
+
+ static public boolean checkIpotesi(Document xmlDocument)
+ {
+ XPath xPath = XPathFactory.newInstance().newXPath();
+ boolean returnValue=false;
+ try
+ {
+ int count = Integer.parseInt(xPath.compile("count(/esercizio/ipotesi)").evaluate(xmlDocument));
+ int numberHp=Integer.parseInt(xPath.compile("count(/esercizio/ipotesi/formula)").evaluate(xmlDocument));
+ if(count==1 && numberHp==0)//se non ci sono ipotesi
+ return true;
+ for(int i=1;i<=numberHp;i++)
+ {
+ boolean valore = checkFormula(xmlDocument, "/esercizio/ipotesi/formula["+i+"]");
+ if(!valore)
+ return false;
+ else
+ returnValue=true;
+ }
+ }catch (Exception e) {
+ e.printStackTrace();
+ }
+ return returnValue;
+ }
+}
--- /dev/null
+package com.company;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+
+
+public class MD5 {
+
+ MD5(){}
+ public static String digest(String filePath) {
+ InputStream inputStream = null;
+ try {
+ inputStream = new FileInputStream(global.locationEsercizi+filePath);
+ byte[] buffer = new byte[1024];
+ MessageDigest digest = MessageDigest.getInstance("MD5");
+ int numRead = 0;
+ while (numRead != -1) {
+ numRead = inputStream.read(buffer);
+ if (numRead > 0)
+ digest.update(buffer, 0, numRead);
+ }
+ byte [] md5Bytes = digest.digest();
+ System.out.println(convertHashToString(md5Bytes));
+ return convertHashToString(md5Bytes);
+ } catch (Exception e) {
+ return null;
+ } finally {
+ if (inputStream != null) {
+ try {
+ inputStream.close();
+ } catch (Exception e) { }
+ }
+ }
+ }
+
+ private static String convertHashToString(byte[] md5Bytes) {
+ String returnVal = "";
+ for (int i = 0; i < md5Bytes.length; i++) {
+ returnVal += Integer.toString(( md5Bytes[i] & 0xff ) + 0x100, 16).substring(1);
+ }
+ return returnVal;
+ }
+}
--- /dev/null
+all:
+ javac -cp "/tmp/ext/mysql-connector-java.jar:/tmp/ext/jdom-2.0.5.jar:/tmp/ext/mail-1.4.1.jar:." *.java
--- /dev/null
+package com.company;
+
+import java.sql.*;
+import java.io.IOException;
+
+import java.math.BigInteger;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+
+import java.util.Random;
+
+import java.sql.Timestamp;
+
+import java.util.ArrayList;
+
+import java.lang.Double;
+
+public class dbConnect
+{
+ private static Connection db;
+ private static Statement stmt;
+ dbConnect()
+ {}
+
+
+ public static Long time()
+ {
+ java.util.Date date= new java.util.Date();
+ Timestamp now=new Timestamp(date.getTime());
+ return now.getTime();
+ }
+
+ //pulisce confmail e connessi da tutte le richieste maggiori di 10 minuti
+ private static void deletetmp() throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException, IOException
+ {
+ PreparedStatement preparedStmt = db.prepareStatement("DELETE FROM confmail WHERE time<=?");
+ preparedStmt.setLong (1,(time()-600000));
+ preparedStmt.execute();
+ preparedStmt = db.prepareStatement("DELETE FROM connessi WHERE time<=?");
+ preparedStmt.setLong (1,(time()-600000));
+ preparedStmt.execute();
+ }
+
+ //divide la stringa in user e password
+ private static String splitUsrPass(String userAndPass, int code) throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException, IOException
+ {
+ String user=null;
+ String pass=null;
+ ArrayList<String> userPass= suString.stringToArrayList(userAndPass);
+ if(userPass.size()>=1)
+ user=userPass.get(0);
+ if(userPass.size()>=2)
+ pass=userPass.get(1);
+
+ assert user != null;
+ if(!user.contains("@studio.unibo.it") && user.length()<16)
+ return "mail-error";
+ else {
+ assert pass != null;
+ if(code==0)
+ return registration(user, pass);
+ else if(code==1)
+ return login(user, pass);
+ else if(code==2)
+ return recupero(user);
+ else
+ return "error";
+ }
+ }
+
+ //routin di gestione recupero pass
+ private static String recupero(String user) throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException, IOException
+ {
+ ResultSet returnQuery=stmt.executeQuery("SELECT * FROM utenti where user='"+user+"'");
+ if(returnQuery!=null)
+ {
+ if(returnQuery.next())
+ {
+ EmailSender email = new EmailSender(global.email,
+ global.emailPass,
+ "smtp.gmail.com",
+ global.email,
+ user,
+ "OGGETTO: recupero password",
+ "la tua password è "+returnQuery.getString("pass"));
+ email.inviaEmail();
+ return "mail-pass-ok";
+ }
+ else
+ return "user-error";
+ }
+ else
+ return "user-error";
+ }
+
+
+ //routin di gestione della registrazione
+ private static String registration(String user, String pass) throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException, IOException
+ {
+ String ran;
+ ResultSet returnQuery=stmt.executeQuery("SELECT * FROM utenti where user='"+user+"'");
+ if(returnQuery!=null)
+ {
+ if(returnQuery.next())
+ {
+ if(returnQuery.getString("user").compareTo(user)==0 && returnQuery.getString("pass").compareTo(pass)==0)
+ return "già -registrato";
+ }
+ }
+ returnQuery=stmt.executeQuery("SELECT * FROM confmail where user='"+user+"'");
+ if(returnQuery!=null)
+ {
+ if(returnQuery.next())
+ {
+ ran=returnQuery.getString("hash");
+ if(returnQuery.getString("pass").compareTo(pass)!=0)
+ {
+ PreparedStatement preparedStmt = db.prepareStatement("UPDATE confmail SET pass =? where user=?");
+ preparedStmt.setString (1,pass);
+ preparedStmt.setString (2,user);
+ preparedStmt.execute();
+ }
+ }
+ else
+ {
+ Random random = new Random();
+ ran=String.valueOf(random.nextInt(100000000)+10000000)+String.valueOf(random.nextInt(100000000)+10000000)+String.valueOf(random.nextInt(100000000)+10000000);
+ //returnQuery=stmt.executeQuery("INSERT INTO confmail VALUES('"+user+"','"+pass+"',"+hash+"')");
+ PreparedStatement preparedStmt = db.prepareStatement("INSERT INTO confmail (user,pass,hash,time) VALUES(?,?,?,?)");
+ preparedStmt.setString (1,user);
+ preparedStmt.setString (2,pass);
+ preparedStmt.setString (3,ran);
+ preparedStmt.setDouble (4,(double)time());
+ preparedStmt.execute();
+ }
+ }
+ else
+ {
+ Random random = new Random();
+ ran=String.valueOf(random.nextInt(100000000)+10000000)+String.valueOf(random.nextInt(100000000)+10000000)+String.valueOf(random.nextInt(100000000)+10000000);
+ //returnQuery=stmt.executeQuery("INSERT INTO confmail VALUES('"+user+"','"+pass+"',"+hash+"')");
+ PreparedStatement preparedStmt = db.prepareStatement("INSERT INTO confmail (user,pass,hash,time) VALUES(?,?,?,?)");
+ preparedStmt.setString (1,user);
+ preparedStmt.setString (2,pass);
+ preparedStmt.setString (3,ran);
+ preparedStmt.setDouble (4,(double)time());
+ preparedStmt.execute();
+ }
+ EmailSender email = new EmailSender(global.email,
+ global.emailPass,
+ "smtp.gmail.com",
+ global.email,
+ user,
+ "OGGETTO: Registrazione App",
+ "per confermare la tua email clicka sul link: http://"+global.serverName+"/test?id="+ran);
+ email.inviaEmail();
+ return "mail-reg-ok";
+ }
+
+ //routin conferma registrazione
+ private static String confirmRegistration(String hash) throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException, IOException
+ {
+ ResultSet returnQuery=stmt.executeQuery("SELECT * FROM confmail where hash='"+hash+"'");
+ if(returnQuery!=null)
+ {
+ if(returnQuery.next())
+ {
+ PreparedStatement preparedStmt = db.prepareStatement("INSERT INTO utenti (user,pass) VALUES(?,?)");
+ preparedStmt.setString (1,returnQuery.getString("user"));
+ preparedStmt.setString (2,returnQuery.getString("pass"));
+ preparedStmt.execute();
+ preparedStmt = db.prepareStatement("DELETE FROM confmail WHERE hash=?");
+ preparedStmt.setString (1,hash);
+ preparedStmt.execute();
+ return "registrazione-ok";
+ }
+ }
+ return "registrazione-error";
+ }
+
+ //routin di gestione login
+ private static String login(String user, String pass) throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException, IOException
+ {
+
+ ResultSet returnQuery=stmt.executeQuery("SELECT * FROM utenti where user='"+user+"' and pass='"+pass+"'");
+ if(returnQuery!=null)
+ {
+ if(returnQuery.next())
+ {
+ if(returnQuery.getString("user").compareTo(user)==0 && returnQuery.getString("pass").compareTo(pass)==0)
+ return putConnessi(user);
+ }
+ }
+ return "login-error";
+ }
+
+
+ //informazioni sulla connessione dell'utente
+ private String infoConnessi(String message) throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException, IOException
+ {
+ ArrayList<String> split= suString.stringToArrayList(message);
+ if(split.size()>=1)
+ {
+ ResultSet returnQuery=stmt.executeQuery("SELECT * FROM connessi WHERE tempkey='"+split.get(1)+"'");
+ if(returnQuery!=null)
+ {
+ if(returnQuery.next())
+ {
+ return "loggato";
+ }
+ }
+ }
+ return "request-login";
+ }
+
+ //inserisce l'utente in connessi
+ private static String putConnessi(String user) throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException, IOException
+ {
+ Random random = new Random();
+ String ran=String.valueOf(random.nextInt(100000000)+10000000)+String.valueOf(random.nextInt(100000000)+10000000);
+ PreparedStatement preparedStmt = db.prepareStatement("INSERT INTO connessi (user,tempkey,thread,time) VALUES(?,?,?,?)");
+ preparedStmt.setString (1,user);
+ preparedStmt.setString (2,ran);
+ preparedStmt.setBoolean (3,false);
+ preparedStmt.setDouble (4,(double)time());
+ preparedStmt.execute();
+ return ran;
+ }
+
+ //segnalare morte di un thread
+ private String threadDead(String key) throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException, IOException
+ {
+ PreparedStatement preparedStmt = db.prepareStatement("DELETE FROM confmail WHERE tempkey=?");
+ preparedStmt.setString (1,key);
+ preparedStmt.execute();
+ return "kill-ok";
+ }
+
+ //remposta il rimer dell'utente nella tabella connessi
+ private String connessiTimer(String key) throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException, IOException
+ {
+ PreparedStatement preparedStmt = db.prepareStatement("UPDATE connessi SET time =? where tempkey=?");
+ preparedStmt.setDouble (1,(double)time());
+ preparedStmt.setString (2,key);
+ preparedStmt.execute();
+ return "timer-settato";
+ }
+
+ private String exerciseAccept(String request) throws SQLException, IOException, NoSuchAlgorithmException {
+ ArrayList<String> input=suString.stringToArrayList(request);
+ ResultSet returnQuery=stmt.executeQuery("SELECT * FROM connessi where tempkey='"+input.get(0)+"'");
+ String utente=null;
+ if(returnQuery!=null)
+ {
+ if(returnQuery.next())
+ utente=returnQuery.getString("user");
+ }
+ if(utente!=null)
+ {
+ String[] esercizi=suString.stringToVectorString(EsNameParser.esName());
+ for(String esercizio : esercizi)
+ {
+ if(esercizio.contentEquals(input.get(1)))//se l'esercizio esiste
+ {
+ if(MD5.digest(esercizio).contentEquals(input.get(2)))//se il digest è uguale
+ {
+ PreparedStatement preparedStmt = db.prepareStatement("INSERT INTO esercizi (esercizio,utente,click,time) VALUES(?,?,?,?)");
+ preparedStmt.setDouble(4, Double.parseDouble(input.get(3)));
+ preparedStmt.setInt (3,Integer.valueOf(input.get(4)));
+ preparedStmt.setString (2,utente);
+ preparedStmt.setString (1,input.get(1));
+ preparedStmt.execute();
+ return "es-ok";
+ }
+ }
+ }
+ }
+ return "es-err";
+ }
+
+ private String userExercise(String request) throws SQLException {
+ ArrayList<String> arrayResult=new ArrayList<String>();
+ ArrayList<String> input=suString.stringToArrayList(request);
+ String result=null;
+ ResultSet returnQuery=stmt.executeQuery("SELECT * FROM connessi where tempkey='"+input.get(0)+"'");
+ String utente=null;
+ if(returnQuery!=null)
+ {
+ if(returnQuery.next())
+ utente=returnQuery.getString("user");
+ }
+ if(utente!=null)
+ {
+ returnQuery=stmt.executeQuery("SELECT * FROM esercizi where utente='"+utente+"'");
+ while(returnQuery.next())
+ {
+ arrayResult.add(returnQuery.getString("esercizio")+"/"+MD5.digest(returnQuery.getString("esercizio"))+"/"+returnQuery.getDouble("time")+"/"+returnQuery.getInt("click"));
+ }
+ result=suString.multiToString(arrayResult);
+ }
+ return result;
+ }
+
+ private String cambiaPass(String request) throws ClassNotFoundException, SQLException, InstantiationException, IOException, IllegalAccessException {
+ ArrayList<String> input=suString.stringToArrayList(request);
+ if(input.size()>=3) {
+ String result = login(input.get(0), input.get(1));
+ if(!result.contains("err"))
+ {
+ PreparedStatement preparedStmt = db.prepareStatement("UPDATE utenti SET pass =? where user=?");
+ preparedStmt.setString (1,input.get(2));
+ preparedStmt.setString (2,input.get(0));
+ preparedStmt.execute();
+ return "cambiata";
+ }
+ }
+ return "error";
+ }
+
+ public String dbQuery(String input) throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException, IOException, NoSuchAlgorithmException {
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ db = DriverManager.getConnection("jdbc:mysql://localhost/logintesi", "root", "csc@CerCo!");
+ stmt = db.createStatement();
+ deletetmp();
+ if (input.charAt(0) == '0')
+ return splitUsrPass(input.substring(2), 0);
+ else if (input.charAt(0) == '1')
+ return splitUsrPass(input.substring(2), 1);
+ else if (input.charAt(0) == '2')
+ return recupero(input.substring(2));
+ else if (input.charAt(0) == '3')
+ return confirmRegistration(input.substring(1));
+ else if (input.charAt(0) == '4')
+ return EsNameParser.esName();
+ else if (input.charAt(0) == '5')
+ return infoConnessi(input.substring(2));
+ else if (input.charAt(0) == '6')
+ return connessiTimer(input.substring(2));
+ /*else if (input.charAt(0) == '7')
+ return threadDead(input.substring(2));*/
+ /*else if(input.charAt(0)=='8')
+ return aggToClient(input.substring(2));
+ else if(input.charAt(0)=='9')
+ return aggForClient(input.substring(2));
+ else if(input.charAt(0)=='a' && input.charAt(1)=='0')
+ return check(input.substring(3));*/
+ else if (input.charAt(0) == '8')
+ return exerciseAccept(input.substring(2));
+ else if (input.charAt(0) == '9')
+ return userExercise(input.substring(2));
+ else if(input.charAt(0)=='a' && input.charAt(1)=='0')
+ return cambiaPass(input.substring(3));
+ return "error";
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<esercizi>\r
+ <esercizio md5="e687f326a904946f498421a0409916bf">aalbero.xml</esercizio>\r
+ <esercizio md5="d3d4772339c39d408a1b92a24d3c9311">tautologia.xml</esercizio>\r
+ <esercizio md5="2a54f15678d8b0fa3b2d1f3824dfd7b6">demorgan.xml</esercizio>\r
+ <esercizio md5="4bfe78fb51248594a8b98ba51eff769f">triviale.xml</esercizio>\r
+ <esercizio md5="97c0cdde7504597040d100cfe3aa1644">test.xml</esercizio>\r
+ <esercizio md5="3c217b2132e40729b6c56c39073a356a">risolvibile.xml</esercizio>\r
+ <esercizio md5="62b5ca97fbf8a5845185ae6010e26828">demorgan2.xml</esercizio>\r
+</esercizi>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<esercizi>\r
+ <esercizio>aalbero.xml</esercizio>\r
+</esercizi>\r
--- /dev/null
+package com.company;
+
+
+public class global {
+ public static final String listaEsercizi="/projects/logicplayer/Server/server/tesi/src/com/company/esercizi.xml";
+ public static final String locationEsercizi="/projects/logicplayer/public_html/esercizi/";
+ public static String home="/projects/logicplayer/Server/server/tesi/src/com/company/";
+ public static String keyStorePass="123456";
+ public static String keyStoreName="keystore.jks";
+ public static String serverName="130.136.129.1";
+ public static String email="confermaiscrizioneserver@gmail.com";
+ public static String emailPass="tes6phev8n";
+ public static int portaServer=25000;
+ public static int portaHttpServer=8000;
+
+}
--- /dev/null
+package com.company;
+
+import java.io.*;
+
+import javax.net.ssl.*;
+
+class guestServer implements Runnable
+{
+ private SSLSocket socket;
+
+ guestServer(SSLSocket client)
+ {
+ socket=client;
+ }
+
+ public void run()
+ {
+ try
+ {
+
+ //Reading the message from the client
+ InputStream is = socket.getInputStream();
+ InputStreamReader isr = new InputStreamReader(is);
+ BufferedReader br = new BufferedReader(isr);
+ String requestMessage = br.readLine();
+ System.out.println("ho ricevuto: "+requestMessage);
+ /*System.out.println("Message received from client is "+returnMessage);
+ dbConnect request=new dbConnect();
+ String returnQuery=request.dbQuery(returnMessage);
+ OutputStream os = socket.getOutputStream();
+ OutputStreamWriter osw = new OutputStreamWriter(os);
+ BufferedWriter bw = new BufferedWriter(osw);
+ System.out.println(returnQuery);
+ bw.write(returnQuery+"\n");
+ bw.flush();*/
+ if(requestMessage!=null)
+ {
+ dbConnect request = new dbConnect();
+ String returnQuery;
+ if ( requestMessage.charAt(0) == '0' ||
+ requestMessage.charAt(0) == '1' ||
+ requestMessage.charAt(0) == '2' ||
+ (requestMessage.charAt(0) == 'a' && requestMessage.charAt(1) == '0')) {
+ returnQuery = request.dbQuery(requestMessage);
+ OutputStream os = socket.getOutputStream();
+ OutputStreamWriter osw = new OutputStreamWriter(os);
+ BufferedWriter bw = new BufferedWriter(osw);
+ bw.write(returnQuery + "\n");
+ bw.flush();
+ System.out.println("ho inviato: " + returnQuery);
+ }
+ else
+ {
+ returnQuery = request.dbQuery("5/" + requestMessage);
+ if (returnQuery.contains("request-login") || returnQuery.contains("request-error"))
+ {
+ OutputStream os = socket.getOutputStream();
+ OutputStreamWriter osw = new OutputStreamWriter(os);
+ BufferedWriter bw = new BufferedWriter(osw);
+ bw.write(returnQuery + "\n");
+ bw.flush();
+ System.out.println("ho inviato: " + returnQuery);
+ }
+ else if (returnQuery.contains("loggato"))
+ {
+ personalServer nuovaConnessione = new personalServer(socket, requestMessage);
+ Thread t = new Thread(nuovaConnessione);
+ t.start();
+ }
+ }
+ }
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+
+ }
+}
--- /dev/null
+package com.company;
+
+import java.io.*;
+import java.net.*;
+import java.security.NoSuchAlgorithmException;
+import java.util.*;
+
+import com.sun.net.httpserver.HttpExchange;
+import com.sun.net.httpserver.HttpHandler;
+import com.sun.net.httpserver.HttpServer;
+import java.sql.*;
+
+public class httpget implements Runnable {
+
+ httpget(){}
+
+ public static Map<String, String> splitQuery(String query) throws UnsupportedEncodingException
+ {
+ Map<String, String> query_pairs = new LinkedHashMap<String, String>();
+ String[] pairs = query.split("&");
+ for (String pair : pairs)
+ {
+ int idx = pair.indexOf("=");
+ query_pairs.put(URLDecoder.decode(pair.substring(0, idx), "UTF-8"), URLDecoder.decode(pair.substring(idx + 1), "UTF-8"));
+ }
+ return query_pairs;
+ }
+
+ @Override
+ public void run() {
+ try {
+ HttpServer server = HttpServer.create(new InetSocketAddress(global.portaHttpServer), 0);
+ server.createContext("/test", new MyHandler());
+ server.setExecutor(null); // creates a default executor
+ server.start();
+ }catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ static class MyHandler implements HttpHandler
+ {
+ public void handle(HttpExchange t) throws IOException
+ {
+
+ /*String response = "This is the response";
+ System.out.println("mannaggia santa");
+ t.sendResponseHeaders(200, response.length());
+ OutputStream os = t.getResponseBody();
+ os.write(response.getBytes());*/
+ URI req=t.getRequestURI();
+ String query=req.getQuery();
+ Map<String, String> result=splitQuery(query);
+ String id=result.get("id");
+ //System.out.println(id);
+ try
+ {
+ dbConnect request=new dbConnect();
+ String returnQuery=request.dbQuery("3"+id);
+ t.sendResponseHeaders(200, returnQuery.length());
+ OutputStream os = t.getResponseBody();
+ os.write(returnQuery.getBytes());
+ os.close();
+ }
+ catch(SQLException e)
+ {}
+ catch(ClassNotFoundException c)
+ {}
+ catch(IllegalAccessException a)
+ {}
+ catch(InstantiationException i)
+ {} catch (NoSuchAlgorithmException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+}
--- /dev/null
+package com.company;
+
+import java.io.BufferedWriter;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+
+import javax.net.ssl.*;
+
+
+import java.util.ArrayList;
+
+class personalServer implements Runnable
+{
+ private SSLSocket socket;
+ private String key;
+ private String requestMessage;
+
+ personalServer(SSLSocket client, String message)
+ {
+ socket=client;
+ ArrayList<String> split= suString.stringToArrayList(message);
+ key=split.get(1);
+ requestMessage=message;
+ }
+
+ public void run()
+ {
+ try
+ {
+ dbConnect request=new dbConnect();
+ String returnQuery=request.dbQuery(requestMessage);
+ OutputStream os = socket.getOutputStream();
+ OutputStreamWriter osw = new OutputStreamWriter(os);
+ BufferedWriter bw = new BufferedWriter(osw);
+ bw.write(returnQuery+"\n");
+ bw.flush();
+ System.out.println("ho inviato: "+returnQuery);
+ request.dbQuery("6/"+key);
+ socket.close();
+ }
+ catch (Exception e)
+ {
+ try
+ {
+ e.printStackTrace();
+ dbConnect request=new dbConnect();
+ request.dbQuery("7/"+key);
+ }
+ catch (Exception k)
+ {
+ //k.printStackTrace();
+ System.out.println("PANIC!");
+ }
+ }
+ }
+}
--- /dev/null
+package com.company;
+
+import java.util.ArrayList;
+import java.util.Collections;
+
+public class suString
+{
+ suString()
+ {}
+
+
+ public static ArrayList<String> stringToArrayList(String string)
+ {
+ ArrayList<String> returnValue=new ArrayList<String>();
+ int j=0;
+ for(int i=0;i<string.length();i++)
+ {
+ if(string.charAt(i)=='/')
+ {
+ returnValue.add(string.substring(j,i));
+ j=i+1;
+ }
+ else if(i==string.length()-1)
+ returnValue.add(string.substring(j));
+ }
+ return returnValue;
+ }
+
+ public static ArrayList<String> vectorStringToArrayList(String[] vectorString)
+ {
+ ArrayList<String> returnValue=new ArrayList<String>();
+ Collections.addAll(returnValue, vectorString);
+ return returnValue;
+ }
+
+ public static String arrayListToString (ArrayList<String> arraylist)
+ {
+ String returnValue= "";
+ for(int i=0;i<arraylist.size();i++)
+ {
+ if(i<arraylist.size()-1)
+ returnValue=returnValue+arraylist.get(i)+"/";
+ else
+ returnValue=returnValue+arraylist.get(i);
+ }
+ return returnValue;
+ }
+
+ public static String vectorStringToString(String[] vectorString)
+ {
+ return arrayListToString(vectorStringToArrayList(vectorString));
+ }
+
+ public static String[] arrayListToVectorString (ArrayList<String> arraylist)
+ {
+ String[] returnValue=new String[arraylist.size()];
+ for(int i=0;i<arraylist.size();i++)
+ returnValue[i]=arraylist.get(i);
+ return returnValue;
+ }
+
+ public static String[] stringToVectorString(String string)
+ {
+ return arrayListToVectorString(stringToArrayList(string));
+ }
+
+ public static String multiToString(ArrayList<String> input)
+ {
+ String returnValue=null;
+ int size=input.size();
+ for(int i=0;i<size;i++)
+ {
+ if(i==0)
+ returnValue=input.get(i);
+ else
+ returnValue=returnValue+"//"+input.get(i);
+ }
+ return returnValue;
+ }
+
+ public static ArrayList<String> stringToMultiArray(String input)
+ {
+ ArrayList<String> result=new ArrayList<String>();
+ int j=0;
+ for(int i=0;i<input.length();i++)
+ {
+ if(input.charAt(i)=='/') {
+ if (input.charAt(i + 1) == '/') {
+ result.add(input.substring(j, i));
+ j=i+2;
+ }
+ }
+ }
+ return result;
+ }
+}
--- /dev/null
+package com.company;
+
+import java.io.*;
+import java.lang.Thread;
+import java.security.*;
+import javax.net.ssl.*;
+
+import java.nio.file.FileSystems;
+import java.nio.file.Path;
+
+
+class superServer
+{
+ public static void main(String[] args)
+ {
+ String ksName = global.home+global.keyStoreName;
+ char ksPass[] = global.keyStorePass.toCharArray();
+ char ctPass[] = global.keyStorePass.toCharArray();
+
+ //thread di controllo directory esercizi
+ Path pathToWatch = FileSystems.getDefault().getPath(global.locationEsercizi);
+ DirectoryWatcher dirWatcher = new DirectoryWatcher(pathToWatch);
+ Thread dirWatcherThread = new Thread(dirWatcher);
+ dirWatcherThread.start();
+
+ //thread che si occupa del lato http
+ httpget regServer=new httpget();
+ Thread httpServer=new Thread(regServer);
+ httpServer.start();
+
+ while(true)
+ {
+ try
+ {
+ KeyStore ks = KeyStore.getInstance("JKS");
+ ks.load(new FileInputStream(ksName), ksPass);
+ KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
+ kmf.init(ks, ctPass);
+ SSLContext sc = SSLContext.getInstance("TLS");
+ sc.init(kmf.getKeyManagers(), null, null);
+ SSLServerSocketFactory ssf = sc.getServerSocketFactory();
+ SSLServerSocket s= (SSLServerSocket) ssf.createServerSocket(global.portaServer);
+ System.out.println("Server started:");
+ while(true)
+ {
+ SSLSocket c = (SSLSocket) s.accept();
+ System.out.println("CSC: debug 1");
+ guestServer guest=new guestServer(c);
+ Thread t=new Thread(guest);
+ t.start();
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+}
--- /dev/null
+package com.company;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.security.NoSuchAlgorithmException;
+
+import org.jdom2.Document;
+import org.jdom2.Element;
+import org.jdom2.JDOMException;
+import org.jdom2.input.SAXBuilder;
+import org.jdom2.output.Format;
+import org.jdom2.output.XMLOutputter;
+
+
+public class xmlOperation {
+
+ xmlOperation(){}
+ static private String pathName=global.listaEsercizi;
+
+ public void create() {
+
+ try {
+
+ Element company = new Element("esercizi");
+ Document doc = new Document(company);
+ doc.setRootElement(company);
+
+ // new XMLOutputter().output(doc, System.out);
+ XMLOutputter xmlOutput = new XMLOutputter();
+
+ // display nice nice
+ xmlOutput.setFormat(Format.getPrettyFormat());
+ xmlOutput.output(doc, new FileWriter(pathName));
+
+ System.out.println("File Saved!");
+ } catch (IOException io) {
+ System.out.println(io.getMessage());
+ }
+ }
+
+
+
+ public void add(String name)
+ {
+ try {
+
+ SAXBuilder builder = new SAXBuilder();
+ File xmlFile = new File(pathName);
+
+ Document doc = (Document) builder.build(xmlFile);
+ Element rootNode = doc.getRootElement();
+
+
+ // add new age element
+ Element newEs = new Element("esercizio").setText(name).setAttribute("md5",MD5.digest(name));
+ rootNode.addContent(newEs);
+
+ XMLOutputter xmlOutput = new XMLOutputter();
+
+ // display nice nice
+ xmlOutput.setFormat(Format.getPrettyFormat());
+ xmlOutput.output(doc, new FileWriter(pathName));
+
+ // xmlOutput.output(doc, System.out);
+
+ System.out.println("File updated!");
+ } catch (IOException io) {
+ io.printStackTrace();
+ } catch (JDOMException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public String getMD5(String name)
+ {
+ try {
+
+ SAXBuilder builder = new SAXBuilder();
+ File xmlFile = new File(pathName);
+
+ Document doc = (Document) builder.build(xmlFile);
+ Element rootNode = doc.getRootElement();
+
+ for(Element esercizio:rootNode.getChildren())
+ {
+ if(esercizio.getText().contentEquals(name))
+ {
+ return esercizio.getAttribute("md5").toString();
+ }
+ }
+ } catch (IOException io) {
+ io.printStackTrace();
+ } catch (JDOMException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public void remove(String name)
+ {
+ try {
+
+ SAXBuilder builder = new SAXBuilder();
+ File xmlFile = new File(pathName);
+
+ Document doc = (Document) builder.build(xmlFile);
+ Element rootNode = doc.getRootElement();
+
+ for(Element esercizio:rootNode.getChildren())
+ {
+ if(esercizio.getText().contentEquals(name))
+ {
+ System.out.println("trovato");
+ rootNode.removeContent(esercizio);
+ }
+ }
+
+ XMLOutputter xmlOutput = new XMLOutputter();
+
+ // display nice nice
+ xmlOutput.setFormat(Format.getPrettyFormat());
+ xmlOutput.output(doc, new FileWriter(pathName));
+
+ // xmlOutput.output(doc, System.out);
+
+ System.out.println("File updated!");
+ } catch (IOException io) {
+ io.printStackTrace();
+ } catch (JDOMException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+}
--- /dev/null
+#!/bin/bash
+
+java -cp "/tmp/ext/mysql-connector-java.jar:/tmp/ext/jdom-2.0.5.jar:/tmp/ext/mail-1.4.1.jar:." com.company.superServer
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
- <component name="CompilerConfiguration">
- <option name="DEFAULT_COMPILER" value="Javac" />
- <resourceExtensions />
- <wildcardResourcePatterns>
- <entry name="!?*.java" />
- <entry name="!?*.form" />
- <entry name="!?*.class" />
- <entry name="!?*.groovy" />
- <entry name="!?*.scala" />
- <entry name="!?*.flex" />
- <entry name="!?*.kt" />
- <entry name="!?*.clj" />
- </wildcardResourcePatterns>
- <annotationProcessing>
- <profile default="true" name="Default" enabled="false">
- <processorPath useClasspath="true" />
- </profile>
- </annotationProcessing>
- </component>
-</project>
\ No newline at end of file
+++ /dev/null
-<component name="CopyrightManager">
- <settings default="" />
-</component>
\ No newline at end of file
+++ /dev/null
-<html>Simple <b>Java</b> application that includes a class with <code>main()</code> method</html>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
- <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
-</project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
- <component name="EntryPointsManager">
- <entry_points version="2.0" />
- </component>
- <component name="ProjectKey">
- <option name="state" value="project://e2804f05-5315-4fc6-a121-c522a6c26470" />
- </component>
- <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true">
- <output url="file://$PROJECT_DIR$/out" />
- </component>
-</project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
- <component name="ProjectModuleManager">
- <modules>
- <module fileurl="file://$PROJECT_DIR$/tesi.iml" filepath="$PROJECT_DIR$/tesi.iml" />
- </modules>
- </component>
-</project>
\ No newline at end of file
+++ /dev/null
-<template>
- <input-field default="com.company">IJ_BASE_PACKAGE</input-field>
-</template>
\ No newline at end of file
+++ /dev/null
-<component name="DependencyValidationManager">
- <state>
- <option name="SKIP_IMPORT_STATEMENTS" value="false" />
- </state>
-</component>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
- <component name="Palette2">
- <group name="Swing">
- <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
- </item>
- <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
- </item>
- <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
- </item>
- <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
- <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
- </item>
- <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
- <initial-values>
- <property name="text" value="Button" />
- </initial-values>
- </item>
- <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
- <initial-values>
- <property name="text" value="RadioButton" />
- </initial-values>
- </item>
- <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
- <initial-values>
- <property name="text" value="CheckBox" />
- </initial-values>
- </item>
- <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
- <initial-values>
- <property name="text" value="Label" />
- </initial-values>
- </item>
- <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
- <preferred-size width="150" height="-1" />
- </default-constraints>
- </item>
- <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
- <preferred-size width="150" height="-1" />
- </default-constraints>
- </item>
- <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
- <preferred-size width="150" height="-1" />
- </default-constraints>
- </item>
- <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
- <preferred-size width="150" height="50" />
- </default-constraints>
- </item>
- <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
- <preferred-size width="150" height="50" />
- </default-constraints>
- </item>
- <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
- <preferred-size width="150" height="50" />
- </default-constraints>
- </item>
- <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
- </item>
- <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
- <preferred-size width="150" height="50" />
- </default-constraints>
- </item>
- <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
- <preferred-size width="150" height="50" />
- </default-constraints>
- </item>
- <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
- <preferred-size width="150" height="50" />
- </default-constraints>
- </item>
- <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
- <preferred-size width="200" height="200" />
- </default-constraints>
- </item>
- <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
- <preferred-size width="200" height="200" />
- </default-constraints>
- </item>
- <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
- <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
- </item>
- <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
- </item>
- <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
- </item>
- <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
- </item>
- <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
- <preferred-size width="-1" height="20" />
- </default-constraints>
- </item>
- <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
- <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
- </item>
- <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
- <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
- </item>
- </group>
- </component>
-</project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
- <component name="VcsDirectoryMappings">
- <mapping directory="" vcs="" />
- </component>
-</project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
- <component name="ChangeListManager">
- <list default="true" id="f9bf9f33-b4ab-4b7e-835e-3aefbf8ab14e" name="Default" comment="" />
- <ignored path="testi.iws" />
- <ignored path=".idea/workspace.xml" />
- <ignored path="$PROJECT_DIR$/out/" />
- <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
- <option name="TRACKING_ENABLED" value="true" />
- <option name="SHOW_DIALOG" value="false" />
- <option name="HIGHLIGHT_CONFLICTS" value="true" />
- <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
- <option name="LAST_RESOLUTION" value="IGNORE" />
- </component>
- <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
- <component name="CreatePatchCommitExecutor">
- <option name="PATCH_PATH" value="" />
- </component>
- <component name="DaemonCodeAnalyzer">
- <disable_hints />
- </component>
- <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
- <component name="FavoritesManager">
- <favorites_list name="testi" />
- </component>
- <component name="FileEditorManager">
- <leaf>
- <file leaf-file-name="EsNameParser.java" pinned="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/src/com/company/EsNameParser.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="90" max-vertical-offset="2466">
- <caret line="17" column="19" selection-start-line="17" selection-start-column="19" selection-end-line="17" selection-end-column="19" />
- <folding />
- </state>
- </provider>
- </entry>
- </file>
- <file leaf-file-name="DirectoryWhatcer.java" pinned="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/src/com/company/DirectoryWhatcer.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="1980">
- <caret line="25" column="42" selection-start-line="25" selection-start-column="42" selection-end-line="25" selection-end-column="42" />
- <folding />
- </state>
- </provider>
- </entry>
- </file>
- <file leaf-file-name="esercizi.xml" pinned="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/src/com/company/esercizi.xml">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="198">
- <caret line="1" column="0" selection-start-line="1" selection-start-column="0" selection-end-line="1" selection-end-column="0" />
- <folding />
- </state>
- </provider>
- </entry>
- </file>
- <file leaf-file-name="global.java" pinned="false" current-in-tab="true">
- <entry file="file://$PROJECT_DIR$/src/com/company/global.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.3452055" vertical-offset="0" max-vertical-offset="730">
- <caret line="14" column="0" selection-start-line="14" selection-start-column="0" selection-end-line="14" selection-end-column="0" />
- <folding />
- </state>
- </provider>
- </entry>
- </file>
- <file leaf-file-name="personalServer.java" pinned="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/src/com/company/personalServer.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="234" max-vertical-offset="990">
- <caret line="20" column="12" selection-start-line="20" selection-start-column="12" selection-end-line="20" selection-end-column="12" />
- <folding />
- </state>
- </provider>
- </entry>
- </file>
- <file leaf-file-name="dbConnect.java" pinned="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/src/com/company/dbConnect.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="2160" max-vertical-offset="5724">
- <caret line="226" column="19" selection-start-line="226" selection-start-column="19" selection-end-line="226" selection-end-column="19" />
- <folding>
- <element signature="imports" expanded="true" />
- </folding>
- </state>
- </provider>
- </entry>
- </file>
- <file leaf-file-name="suString.java" pinned="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/src/com/company/suString.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="324" max-vertical-offset="1296">
- <caret line="18" column="13" selection-start-line="18" selection-start-column="13" selection-end-line="18" selection-end-column="13" />
- <folding>
- <element signature="imports" expanded="true" />
- </folding>
- </state>
- </provider>
- </entry>
- </file>
- <file leaf-file-name="superServer.java" pinned="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/src/com/company/superServer.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="38" max-vertical-offset="1044">
- <caret line="16" column="24" selection-start-line="16" selection-start-column="24" selection-end-line="16" selection-end-column="43" />
- <folding />
- </state>
- </provider>
- </entry>
- </file>
- <file leaf-file-name="guestServer.java" pinned="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/src/com/company/guestServer.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="1242" max-vertical-offset="1404">
- <caret line="74" column="0" selection-start-line="74" selection-start-column="0" selection-end-line="74" selection-end-column="0" />
- <folding />
- </state>
- </provider>
- </entry>
- </file>
- </leaf>
- </component>
- <component name="IdeDocumentHistory">
- <option name="CHANGED_PATHS">
- <list>
- <option value="$PROJECT_DIR$/src/com/company/testEsname.java" />
- <option value="$PROJECT_DIR$/src/com/company/DeleteFileExample.java" />
- <option value="$PROJECT_DIR$/src/com/server/superServer.java" />
- <option value="$PROJECT_DIR$/src/com/server/xmlOperation.java" />
- <option value="$PROJECT_DIR$/src/com/server/DirectoryWhatcer.java" />
- <option value="$PROJECT_DIR$/src/com/company/hash.java" />
- <option value="$PROJECT_DIR$/src/com/company/gommo.java" />
- <option value="$PROJECT_DIR$/src/com/company/xmlOperation.java" />
- <option value="$PROJECT_DIR$/src/com/company/MD5.java" />
- <option value="$PROJECT_DIR$/src/com/company/guestServer.java" />
- <option value="$PROJECT_DIR$/src/com/company/EmailSender.java" />
- <option value="$PROJECT_DIR$/src/com/company/suString.java" />
- <option value="$PROJECT_DIR$/src/com/company/httpget.java" />
- <option value="$PROJECT_DIR$/src/com/company/personalServer.java" />
- <option value="$PROJECT_DIR$/src/com/company/dbConnect.java" />
- <option value="$PROJECT_DIR$/src/com/company/EsNameParser.java" />
- <option value="$PROJECT_DIR$/src/com/company/DirectoryWhatcer.java" />
- <option value="$PROJECT_DIR$/src/com/company/superServer.java" />
- <option value="$PROJECT_DIR$/src/com/company/global.java" />
- </list>
- </option>
- </component>
- <component name="ProjectFrameBounds">
- <option name="x" value="-1" />
- <option name="y" value="26" />
- <option name="width" value="1442" />
- <option name="height" value="875" />
- </component>
- <component name="ProjectInspectionProfilesVisibleTreeState">
- <entry key="Project Default">
- <profile-state>
- <expanded-state>
- <State>
- <id />
- </State>
- <State>
- <id>Control flow issues</id>
- </State>
- </expanded-state>
- <selected-state>
- <State>
- <id>InfiniteLoopStatement</id>
- </State>
- </selected-state>
- </profile-state>
- </entry>
- </component>
- <component name="ProjectLevelVcsManager" settingsEditedManually="false">
- <OptionsSetting value="true" id="Add" />
- <OptionsSetting value="true" id="Remove" />
- <OptionsSetting value="true" id="Checkout" />
- <OptionsSetting value="true" id="Update" />
- <OptionsSetting value="true" id="Status" />
- <OptionsSetting value="true" id="Edit" />
- <ConfirmationsSetting value="0" id="Add" />
- <ConfirmationsSetting value="0" id="Remove" />
- </component>
- <component name="ProjectView">
- <navigator currentView="ProjectPane" proportions="" version="1">
- <flattenPackages />
- <showMembers />
- <showModules />
- <showLibraryContents />
- <hideEmptyPackages />
- <abbreviatePackageNames />
- <autoscrollToSource />
- <autoscrollFromSource />
- <sortByType />
- </navigator>
- <panes>
- <pane id="Scope" />
- <pane id="PackagesPane" />
- <pane id="ProjectPane">
- <subPane>
- <PATH>
- <PATH_ELEMENT>
- <option name="myItemId" value="testi" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
- </PATH_ELEMENT>
- </PATH>
- <PATH>
- <PATH_ELEMENT>
- <option name="myItemId" value="testi" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="testi" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- </PATH>
- <PATH>
- <PATH_ELEMENT>
- <option name="myItemId" value="testi" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="testi" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="src" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="company" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- </PATH>
- <PATH>
- <PATH_ELEMENT>
- <option name="myItemId" value="testi" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="testi" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="src" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="company" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="DirectoryWhatcer.java" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.ClassesTreeStructureProvider$PsiClassOwnerTreeNode" />
- </PATH_ELEMENT>
- </PATH>
- </subPane>
- </pane>
- </panes>
- </component>
- <component name="PropertiesComponent">
- <property name="GoToClass.includeLibraries" value="false" />
- <property name="GoToClass.toSaveIncludeLibraries" value="false" />
- <property name="GoToFile.includeJavaFiles" value="false" />
- <property name="MemberChooser.sorted" value="false" />
- <property name="MemberChooser.showClasses" value="true" />
- <property name="MemberChooser.copyJavadoc" value="false" />
- <property name="recentsLimit" value="5" />
- <property name="restartRequiresConfirmation" value="true" />
- <property name="FullScreen" value="false" />
- <property name="last_opened_file_path" value="$PROJECT_DIR$" />
- <property name="options.lastSelected" value="editor.preferences.appearance" />
- <property name="options.splitter.main.proportions" value="0.3" />
- <property name="options.splitter.details.proportions" value="0.2" />
- <property name="project.structure.last.edited" value="SDKs" />
- <property name="project.structure.proportion" value="0.15" />
- <property name="project.structure.side.proportion" value="0.2" />
- <property name="dynamic.classpath" value="false" />
- </component>
- <component name="RunManager" selected="Application.Main">
- <configuration default="true" type="JUnit" factoryName="JUnit">
- <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
- <module name="" />
- <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
- <option name="ALTERNATIVE_JRE_PATH" />
- <option name="PACKAGE_NAME" />
- <option name="MAIN_CLASS_NAME" />
- <option name="METHOD_NAME" />
- <option name="TEST_OBJECT" value="class" />
- <option name="VM_PARAMETERS" />
- <option name="PARAMETERS" />
- <option name="WORKING_DIRECTORY" />
- <option name="ENV_VARIABLES" />
- <option name="PASS_PARENT_ENVS" value="true" />
- <option name="TEST_SEARCH_SCOPE">
- <value defaultName="singleModule" />
- </option>
- <envs />
- <patterns />
- <method />
- </configuration>
- <configuration default="true" type="AndroidRunConfigurationType" factoryName="Android Application">
- <module name="" />
- <option name="ACTIVITY_CLASS" value="" />
- <option name="MODE" value="default_activity" />
- <option name="DEPLOY" value="true" />
- <option name="ARTIFACT_NAME" value="" />
- <option name="TARGET_SELECTION_MODE" value="EMULATOR" />
- <option name="USE_LAST_SELECTED_DEVICE" value="false" />
- <option name="PREFERRED_AVD" value="" />
- <option name="USE_COMMAND_LINE" value="true" />
- <option name="COMMAND_LINE" value="" />
- <option name="WIPE_USER_DATA" value="false" />
- <option name="DISABLE_BOOT_ANIMATION" value="false" />
- <option name="NETWORK_SPEED" value="full" />
- <option name="NETWORK_LATENCY" value="none" />
- <option name="CLEAR_LOGCAT" value="false" />
- <option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
- <option name="FILTER_LOGCAT_AUTOMATICALLY" value="true" />
- <method />
- </configuration>
- <configuration default="true" type="AndroidTestRunConfigurationType" factoryName="Android Tests">
- <module name="" />
- <option name="TESTING_TYPE" value="0" />
- <option name="INSTRUMENTATION_RUNNER_CLASS" value="" />
- <option name="METHOD_NAME" value="" />
- <option name="CLASS_NAME" value="" />
- <option name="PACKAGE_NAME" value="" />
- <option name="TARGET_SELECTION_MODE" value="EMULATOR" />
- <option name="USE_LAST_SELECTED_DEVICE" value="false" />
- <option name="PREFERRED_AVD" value="" />
- <option name="USE_COMMAND_LINE" value="true" />
- <option name="COMMAND_LINE" value="" />
- <option name="WIPE_USER_DATA" value="false" />
- <option name="DISABLE_BOOT_ANIMATION" value="false" />
- <option name="NETWORK_SPEED" value="full" />
- <option name="NETWORK_LATENCY" value="none" />
- <option name="CLEAR_LOGCAT" value="false" />
- <option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
- <option name="FILTER_LOGCAT_AUTOMATICALLY" value="true" />
- <method />
- </configuration>
- <configuration default="true" type="GradleRunConfiguration" factoryName="Gradle">
- <ExternalSystemSettings>
- <option name="executionName" />
- <option name="externalProjectPath" />
- <option name="externalSystemIdString" value="GRADLE" />
- <option name="scriptParameters" />
- <option name="taskDescriptions">
- <list />
- </option>
- <option name="taskNames">
- <list />
- </option>
- <option name="vmOptions" />
- </ExternalSystemSettings>
- <method />
- </configuration>
- <configuration default="true" type="JarApplication" factoryName="JAR Application">
- <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
- <envs />
- <method />
- </configuration>
- <configuration default="true" type="Application" factoryName="Application">
- <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
- <option name="MAIN_CLASS_NAME" />
- <option name="VM_PARAMETERS" />
- <option name="PROGRAM_PARAMETERS" />
- <option name="WORKING_DIRECTORY" />
- <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
- <option name="ALTERNATIVE_JRE_PATH" />
- <option name="ENABLE_SWING_INSPECTOR" value="false" />
- <option name="ENV_VARIABLES" />
- <option name="PASS_PARENT_ENVS" value="true" />
- <module name="" />
- <envs />
- <method />
- </configuration>
- <configuration default="true" type="TestNG" factoryName="TestNG">
- <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
- <module name="" />
- <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
- <option name="ALTERNATIVE_JRE_PATH" />
- <option name="SUITE_NAME" />
- <option name="PACKAGE_NAME" />
- <option name="MAIN_CLASS_NAME" />
- <option name="METHOD_NAME" />
- <option name="GROUP_NAME" />
- <option name="TEST_OBJECT" value="CLASS" />
- <option name="VM_PARAMETERS" />
- <option name="PARAMETERS" />
- <option name="WORKING_DIRECTORY" />
- <option name="OUTPUT_DIRECTORY" />
- <option name="ANNOTATION_TYPE" />
- <option name="ENV_VARIABLES" />
- <option name="PASS_PARENT_ENVS" value="true" />
- <option name="TEST_SEARCH_SCOPE">
- <value defaultName="singleModule" />
- </option>
- <option name="USE_DEFAULT_REPORTERS" value="false" />
- <option name="PROPERTIES_FILE" />
- <envs />
- <properties />
- <listeners />
- <method />
- </configuration>
- <configuration default="false" name="Main" type="Application" factoryName="Application">
- <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
- <option name="MAIN_CLASS_NAME" value="com.company.superServer" />
- <option name="VM_PARAMETERS" value="" />
- <option name="PROGRAM_PARAMETERS" value="" />
- <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
- <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
- <option name="ALTERNATIVE_JRE_PATH" value="" />
- <option name="ENABLE_SWING_INSPECTOR" value="false" />
- <option name="ENV_VARIABLES" />
- <option name="PASS_PARENT_ENVS" value="true" />
- <module name="tesi" />
- <envs />
- <RunnerSettings RunnerId="Debug">
- <option name="DEBUG_PORT" value="" />
- <option name="TRANSPORT" value="0" />
- <option name="LOCAL" value="true" />
- </RunnerSettings>
- <RunnerSettings RunnerId="Run" />
- <ConfigurationWrapper RunnerId="Debug" />
- <ConfigurationWrapper RunnerId="Run" />
- <method />
- </configuration>
- <list size="1">
- <item index="0" class="java.lang.String" itemvalue="Application.Main" />
- </list>
- </component>
- <component name="ShelveChangesManager" show_recycled="false" />
- <component name="SvnConfiguration">
- <configuration />
- </component>
- <component name="TaskManager">
- <task active="true" id="Default" summary="Default task">
- <changelist id="f9bf9f33-b4ab-4b7e-835e-3aefbf8ab14e" name="Default" comment="" />
- <created>1415700559063</created>
- <option name="number" value="Default" />
- <updated>1415700559063</updated>
- </task>
- <servers />
- </component>
- <component name="ToolWindowManager">
- <frame x="-1" y="26" width="1442" height="875" extended-state="6" />
- <editor active="false" />
- <layout>
- <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
- <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
- <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
- <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32820514" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
- <window_info id="Palette	" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
- <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
- <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3992298" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
- <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
- <window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
- <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
- <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32760897" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
- <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
- <window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
- <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25679544" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
- <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
- <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
- <window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
- <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
- <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3976222" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
- <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
- <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
- <window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32991013" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
- <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
- <window_info id="Module Dependencies" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32962447" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
- <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
- <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32991013" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
- </layout>
- </component>
- <component name="Vcs.Log.UiProperties">
- <option name="RECENTLY_FILTERED_USER_GROUPS">
- <collection />
- </option>
- <option name="RECENTLY_FILTERED_BRANCH_GROUPS">
- <collection />
- </option>
- </component>
- <component name="VcsContentAnnotationSettings">
- <option name="myLimit" value="2678400000" />
- </component>
- <component name="VcsManagerConfiguration">
- <option name="myTodoPanelSettings">
- <TodoPanelSettings />
- </option>
- </component>
- <component name="XDebuggerManager">
- <breakpoint-manager>
- <option name="time" value="5" />
- </breakpoint-manager>
- <watches-manager />
- </component>
- <component name="antWorkspaceConfiguration">
- <option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
- <option name="FILTER_TARGETS" value="false" />
- </component>
- <component name="editorHistoryManager">
- <entry file="file://$PROJECT_DIR$/src/com/company/guestServer.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="1242" max-vertical-offset="1404">
- <caret line="74" column="0" selection-start-line="74" selection-start-column="0" selection-end-line="74" selection-end-column="0" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/EsNameParser.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="1548" max-vertical-offset="2466">
- <caret line="98" column="21" selection-start-line="98" selection-start-column="21" selection-end-line="98" selection-end-column="21" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/global.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="144" max-vertical-offset="252">
- <caret line="8" column="0" selection-start-line="8" selection-start-column="0" selection-end-line="8" selection-end-column="0" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/EmailSender.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="43" max-vertical-offset="2088">
- <caret line="15" column="0" selection-start-line="15" selection-start-column="0" selection-end-line="15" selection-end-column="0" />
- <folding>
- <element signature="imports" expanded="true" />
- </folding>
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/suString.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="1296">
- <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
- <folding>
- <element signature="imports" expanded="true" />
- </folding>
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/guestServer.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="905" max-vertical-offset="1404">
- <caret line="74" column="0" selection-start-line="74" selection-start-column="0" selection-end-line="74" selection-end-column="0" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/DirectoryWhatcer.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="162" max-vertical-offset="1638">
- <caret line="29" column="62" selection-start-line="29" selection-start-column="37" selection-end-line="29" selection-end-column="62" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/xmlOperation.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="1059" max-vertical-offset="2556">
- <caret line="71" column="9" selection-start-line="71" selection-start-column="9" selection-end-line="71" selection-end-column="9" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/superServer.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="291" max-vertical-offset="1044">
- <caret line="41" column="0" selection-start-line="41" selection-start-column="0" selection-end-line="41" selection-end-column="0" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/EsNameParser.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="180" max-vertical-offset="2466">
- <caret line="22" column="80" selection-start-line="22" selection-start-column="80" selection-end-line="22" selection-end-column="80" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/httpget.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="646" max-vertical-offset="1386">
- <caret line="59" column="59" selection-start-line="59" selection-start-column="59" selection-end-line="59" selection-end-column="59" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/personalServer.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="270" max-vertical-offset="1098">
- <caret line="22" column="30" selection-start-line="22" selection-start-column="30" selection-end-line="22" selection-end-column="30" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/dbConnect.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="7131" max-vertical-offset="8262">
- <caret line="449" column="45" selection-start-line="449" selection-start-column="45" selection-end-line="449" selection-end-column="45" />
- <folding>
- <element signature="imports" expanded="true" />
- </folding>
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/MD5.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="16" max-vertical-offset="756">
- <caret line="19" column="71" selection-start-line="19" selection-start-column="71" selection-end-line="19" selection-end-column="71" />
- <folding>
- <element signature="imports" expanded="true" />
- </folding>
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/DirectoryWhatcer.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="162" max-vertical-offset="1638">
- <caret line="29" column="62" selection-start-line="29" selection-start-column="37" selection-end-line="29" selection-end-column="62" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/xmlOperation.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="826" max-vertical-offset="2592">
- <caret line="55" column="97" selection-start-line="55" selection-start-column="97" selection-end-line="55" selection-end-column="97" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/superServer.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="291" max-vertical-offset="1044">
- <caret line="41" column="0" selection-start-line="41" selection-start-column="0" selection-end-line="41" selection-end-column="0" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/EsNameParser.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="2466">
- <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/httpget.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="486" max-vertical-offset="1350">
- <caret line="57" column="20" selection-start-line="57" selection-start-column="20" selection-end-line="57" selection-end-column="20" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/guestServer.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="270" max-vertical-offset="1548">
- <caret line="23" column="41" selection-start-line="23" selection-start-column="41" selection-end-line="23" selection-end-column="41" />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/personalServer.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="363" max-vertical-offset="1116">
- <caret line="11" column="6" selection-start-line="11" selection-start-column="6" selection-end-line="11" selection-end-column="6" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/dbConnect.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="6928" max-vertical-offset="7668">
- <caret line="15" column="5" selection-start-line="15" selection-start-column="5" selection-end-line="15" selection-end-column="5" />
- <folding>
- <element signature="imports" expanded="true" />
- </folding>
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/MD5.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="16" max-vertical-offset="756">
- <caret line="13" column="16" selection-start-line="13" selection-start-column="16" selection-end-line="13" selection-end-column="16" />
- <folding>
- <element signature="imports" expanded="true" />
- </folding>
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/xmlOperation.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="1317" max-vertical-offset="2592">
- <caret line="98" column="20" selection-start-line="98" selection-start-column="20" selection-end-line="98" selection-end-column="20" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/superServer.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="549" max-vertical-offset="1044">
- <caret line="41" column="0" selection-start-line="41" selection-start-column="0" selection-end-line="41" selection-end-column="0" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/EsNameParser.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="558" max-vertical-offset="2466">
- <caret line="59" column="13" selection-start-line="59" selection-start-column="13" selection-end-line="59" selection-end-column="13" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/httpget.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="1350">
- <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/DirectoryWhatcer.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="162" max-vertical-offset="1530">
- <caret line="40" column="61" selection-start-line="40" selection-start-column="61" selection-end-line="40" selection-end-column="61" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/xmlOperation.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="657" max-vertical-offset="2016">
- <caret line="51" column="0" selection-start-line="51" selection-start-column="0" selection-end-line="52" selection-end-column="0" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/superServer.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="342" max-vertical-offset="1044">
- <caret line="35" column="44" selection-start-line="35" selection-start-column="44" selection-end-line="35" selection-end-column="44" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/EsNameParser.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="2466">
- <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/httpget.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="126" max-vertical-offset="1350">
- <caret line="16" column="0" selection-start-line="16" selection-start-column="0" selection-end-line="16" selection-end-column="0" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/DirectoryWhatcer.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="76" max-vertical-offset="1422">
- <caret line="34" column="20" selection-start-line="34" selection-start-column="20" selection-end-line="34" selection-end-column="20" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="jar:///usr/lib/jvm/java-8-oracle/src.zip!/java/lang/ClassLoader.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.33333334" vertical-offset="5109" max-vertical-offset="38286">
- <caret line="356" column="0" selection-start-line="356" selection-start-column="0" selection-end-line="356" selection-end-column="0" />
- </state>
- </provider>
- </entry>
- <entry file="jar:///usr/lib/jvm/java-8-oracle/src.zip!/java/lang/Class.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.33333334" vertical-offset="3273" max-vertical-offset="63540">
- <caret line="258" column="0" selection-start-line="258" selection-start-column="0" selection-end-line="258" selection-end-column="0" />
- </state>
- </provider>
- </entry>
- <entry file="jar:///usr/lib/jvm/java-8-oracle/src.zip!/java/lang/Thread.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="12201" max-vertical-offset="35352">
- <caret line="744" column="0" selection-start-line="744" selection-start-column="0" selection-end-line="744" selection-end-column="0" />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/tesi.iml">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="753">
- <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
- </state>
- </provider>
- </entry>
- <entry file="jar:///usr/lib/jvm/java-8-oracle/jre/lib/ext/commons-codec-1.10.jar!/org/apache/commons/codec/binary/Hex.class">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.27197802" vertical-offset="0" max-vertical-offset="1998">
- <caret line="19" column="23" selection-start-line="0" selection-start-column="0" selection-end-line="131" selection-end-column="0" />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/xmlOperation.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.19672132" vertical-offset="0" max-vertical-offset="2376">
- <caret line="18" column="55" selection-start-line="18" selection-start-column="35" selection-end-line="18" selection-end-column="55" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/MD5.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.051460363" vertical-offset="161" max-vertical-offset="936">
- <caret line="11" column="11" selection-start-line="11" selection-start-column="11" selection-end-line="11" selection-end-column="11" />
- <folding>
- <element signature="imports" expanded="true" />
- </folding>
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/suString.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="324" max-vertical-offset="1296">
- <caret line="18" column="13" selection-start-line="18" selection-start-column="13" selection-end-line="18" selection-end-column="13" />
- <folding>
- <element signature="imports" expanded="true" />
- </folding>
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/EmailSender.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.21311475" vertical-offset="1302" max-vertical-offset="2088">
- <caret line="81" column="37" selection-start-line="81" selection-start-column="37" selection-end-line="81" selection-end-column="37" />
- <folding>
- <element signature="imports" expanded="true" />
- </folding>
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/httpget.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.5757997" vertical-offset="0" max-vertical-offset="1386">
- <caret line="31" column="94" selection-start-line="31" selection-start-column="94" selection-end-line="31" selection-end-column="94" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/guestServer.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="905" max-vertical-offset="1404">
- <caret line="74" column="0" selection-start-line="74" selection-start-column="0" selection-end-line="74" selection-end-column="0" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/personalServer.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="990">
- <caret line="20" column="12" selection-start-line="20" selection-start-column="12" selection-end-line="20" selection-end-column="12" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/superServer.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="38" max-vertical-offset="1044">
- <caret line="16" column="24" selection-start-line="16" selection-start-column="24" selection-end-line="16" selection-end-column="43" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/dbConnect.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="2160" max-vertical-offset="5724">
- <caret line="226" column="19" selection-start-line="226" selection-start-column="19" selection-end-line="226" selection-end-column="19" />
- <folding>
- <element signature="imports" expanded="true" />
- </folding>
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/DirectoryWhatcer.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="1980">
- <caret line="25" column="42" selection-start-line="25" selection-start-column="42" selection-end-line="25" selection-end-column="42" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/esercizi.xml">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="198">
- <caret line="1" column="0" selection-start-line="1" selection-start-column="0" selection-end-line="1" selection-end-column="0" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/EsNameParser.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="2466">
- <caret line="17" column="19" selection-start-line="17" selection-start-column="19" selection-end-line="17" selection-end-column="19" />
- <folding />
- </state>
- </provider>
- </entry>
- <entry file="file://$PROJECT_DIR$/src/com/company/global.java">
- <provider selected="true" editor-type-id="text-editor">
- <state vertical-scroll-proportion="0.3452055" vertical-offset="0" max-vertical-offset="730">
- <caret line="14" column="0" selection-start-line="14" selection-start-column="0" selection-end-line="14" selection-end-column="0" />
- <folding />
- </state>
- </provider>
- </entry>
- </component>
- <component name="masterDetails">
- <states>
- <state key="ArtifactsStructureConfigurable.UI">
- <settings>
- <artifact-editor />
- <splitter-proportions>
- <option name="proportions">
- <list>
- <option value="0.2" />
- </list>
- </option>
- </splitter-proportions>
- </settings>
- </state>
- <state key="FacetStructureConfigurable.UI">
- <settings>
- <last-edited>No facets are configured</last-edited>
- <splitter-proportions>
- <option name="proportions">
- <list>
- <option value="0.2" />
- </list>
- </option>
- </splitter-proportions>
- </settings>
- </state>
- <state key="GlobalLibrariesConfigurable.UI">
- <settings>
- <splitter-proportions>
- <option name="proportions">
- <list>
- <option value="0.2" />
- </list>
- </option>
- </splitter-proportions>
- </settings>
- </state>
- <state key="JdkListConfigurable.UI">
- <settings>
- <last-edited>1.8</last-edited>
- <splitter-proportions>
- <option name="proportions">
- <list>
- <option value="0.2" />
- </list>
- </option>
- </splitter-proportions>
- </settings>
- </state>
- <state key="ModuleStructureConfigurable.UI">
- <settings>
- <last-edited>tesi</last-edited>
- <splitter-proportions>
- <option name="proportions">
- <list>
- <option value="0.2" />
- </list>
- </option>
- </splitter-proportions>
- </settings>
- </state>
- <state key="ProjectLibrariesConfigurable.UI">
- <settings>
- <splitter-proportions>
- <option name="proportions">
- <list>
- <option value="0.2" />
- </list>
- </option>
- </splitter-proportions>
- </settings>
- </state>
- </states>
- </component>
-</project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<esercizi>\r
- <esercizio md5="e687f326a904946f498421a0409916bf">aalbero.xml</esercizio>\r
- <esercizio md5="d3d4772339c39d408a1b92a24d3c9311">tautologia.xml</esercizio>\r
-</esercizi>\r
+++ /dev/null
-<esercizi>
- <esercizio>albero.xml</esercizio>
-</esercizi>
\ No newline at end of file
+++ /dev/null
-package com.company;
-
-import java.io.*;
-import java.nio.file.Path;
-import java.nio.file.StandardWatchEventKinds;
-import java.nio.file.WatchEvent;
-import java.nio.file.WatchEvent.Kind;
-import java.nio.file.WatchKey;
-import java.nio.file.WatchService;
-import java.security.NoSuchAlgorithmException;
-import java.sql.SQLException;
-import java.util.ArrayList;
-
-// Simple class to watch directory events.
-class DirectoryWatcher implements Runnable {
-
- private Path path;
-
- public DirectoryWatcher(Path path) {
- this.path = path;
- }
-
- //rimuove tutti gli elementi non validi
- private void pulisciCartella() {
- File dir = new File(global.locationEsercizi);
- String[] lista=dir.list();
- for(String name : lista)
- {
- if (!EsNameParser.check(name))
- {
- File file = new File(global.locationEsercizi+name);
- if (file.delete())
- System.out.println("eliminato: "+name);
- else
- System.out.println("problema di eliminazione file");
- }
- else
- {
- xmlOperation es=new xmlOperation();
- File car=new File(global.listaEsercizi);
- if (car.exists()) {
- dbConnect db=new dbConnect();
- try {
- ArrayList<String> esercizi=suString.stringToArrayList(db.dbQuery("4"));
- boolean add=true;
- for(String esercizio : esercizi)
- {
- if(esercizio.equals(name))
- add=false;
- }
- if(add)
- es.add(name);
- } catch (SQLException e) {
- e.printStackTrace();
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (InstantiationException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- } catch (NoSuchAlgorithmException e) {
- e.printStackTrace();
- }
- }
- }
- }
- }
-
- // print the events and the affected file
- private void printEvent(WatchEvent<?> event) throws IOException {
- Kind<?> kind = event.kind();
- if (kind.equals(StandardWatchEventKinds.ENTRY_CREATE))
- {
- Path pathCreated = (Path) event.context();
- System.out.println("Entry created:" + pathCreated);
- boolean check = EsNameParser.check(pathCreated.getFileName().toString());
- if(!check)
- {
- File file = new File(global.locationEsercizi+pathCreated.getFileName().toString());
- if(file.delete())
- System.out.println("eliminato");
- else
- System.out.println("problema di eliminazione file");
- }
- else
- {
- xmlOperation es=new xmlOperation();
- File dir=new File(global.listaEsercizi);
- if (dir.exists())
- es.add(pathCreated.getFileName().toString());
- }
- }
- else if (kind.equals(StandardWatchEventKinds.ENTRY_DELETE))
- {
- Path pathDeleted = (Path) event.context();
- System.out.println("Entry deleted:" + pathDeleted);
- xmlOperation es=new xmlOperation();
- File dir=new File(global.listaEsercizi);
- if (dir.exists())
- es.remove(pathDeleted.getFileName().toString());
- }
- else if (kind.equals(StandardWatchEventKinds.ENTRY_MODIFY))
- {
- Path pathModified = (Path) event.context();
- System.out.println("Entry modified:" + pathModified);
- }
- }
-
- @Override
- public void run() {
- try {
- pulisciCartella();
- WatchService watchService = path.getFileSystem().newWatchService();
- path.register(watchService, StandardWatchEventKinds.ENTRY_CREATE,
- StandardWatchEventKinds.ENTRY_MODIFY, StandardWatchEventKinds.ENTRY_DELETE);
-
- // loop forever to watch directory
- while (true) {
- WatchKey watchKey;
- watchKey = watchService.take(); // this call is blocking until events are present
-
- // poll for file system events on the WatchKey
- for (final WatchEvent<?> event : watchKey.pollEvents()) {
- printEvent(event);
- }
-
- // if the watched directed gets deleted, get out of run method
- if (!watchKey.reset()) {
- System.out.println("No longer valid");
- watchKey.cancel();
- watchService.close();
- break;
- }
- }
-
- } catch (InterruptedException ex) {
- System.out.println("interrupted. Goodbye");
- return;
- } catch (IOException ex) {
- ex.printStackTrace(); // don't do this in production code. Use a loggin framework
- return;
- }
- }
-
-}
+++ /dev/null
-package com.company;
-
-import java.util.Date;
-import java.util.Properties;
-import javax.mail.Message;
-import javax.mail.MessagingException;
-import javax.mail.Multipart;
-import javax.mail.NoSuchProviderException;
-import javax.mail.Session;
-import javax.mail.Transport;
-import javax.mail.internet.AddressException;
-import javax.mail.internet.InternetAddress;
-import javax.mail.internet.MimeBodyPart;
-import javax.mail.internet.MimeMessage;
-import javax.mail.internet.MimeMultipart;
-
-
-
-public class EmailSender {
- private String user;
- private String password;
- private String host;
- private String mittente;
- private String destinatario;
- private String oggetto;
- private String mess;
-
-
- EmailSender(String user, String password, String host,
- String mittente, String destinatario,
- String oggetto, String mess){
-
- this.user = user;
- this.password = password;
- this.host = host;
- this.mittente = mittente;
- this.destinatario = destinatario;
- this.oggetto = oggetto;
- this.mess=mess;
- }
-
-
- // Metodo che si occupa dell'invio effettivo della mail
- public void inviaEmail() {
- int port = 465; //porta 25 per non usare SSL
-
- Properties props = new Properties();
- props.put("mail.smtp.auth", "true");
- props.put("mail.smtp.user", mittente);
- props.put("mail.smtp.host", host);
- props.put("mail.smtp.port", port);
-
- // commentare la riga seguente per non usare SSL
- props.put("mail.smtp.starttls.enable","true");
- props.put("mail.smtp.socketFactory.port", port);
-
- // commentare la riga seguente per non usare SSL
- props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
- props.put("mail.smtp.socketFactory.fallback", "false");
-
- Session session = Session.getInstance(props, null);
- session.setDebug(true);
-
- // Creazione delle BodyParts del messaggio
- MimeBodyPart messageBodyPart1 = new MimeBodyPart();
-
- try{
- // COSTRUZIONE DEL MESSAGGIO
- Multipart multipart = new MimeMultipart();
- MimeMessage msg = new MimeMessage(session);
-
- // header del messaggio
- msg.setSubject(oggetto);
- msg.setSentDate(new Date());
- msg.setFrom(new InternetAddress(mittente));
-
- // destinatario
- msg.addRecipient(Message.RecipientType.TO,
- new InternetAddress(destinatario));
-
- // corpo del messaggio
- messageBodyPart1.setText(mess);
- multipart.addBodyPart(messageBodyPart1);
-
- // allegato al messaggio
- /*DataSource source = new FileDataSource(allegato);
- messageBodyPart2.setDataHandler(new DataHandler(source));
- messageBodyPart2.setFileName(allegato);
- multipart.addBodyPart(messageBodyPart2);*/
-
- // inserimento delle parti nel messaggio
- msg.setContent(multipart);
-
- Transport transport = session.getTransport("smtps"); //("smtp") per non usare SSL
- transport.connect(host, user, password);
- transport.sendMessage(msg, msg.getAllRecipients());
- transport.close();
-
- System.out.println("Invio dell'email Terminato");
-
- }catch(AddressException ae) {
- ae.printStackTrace();
- }catch(NoSuchProviderException nspe){
- nspe.printStackTrace();
- }catch(MessagingException me){
- me.printStackTrace();
- }
-
- }
-}
+++ /dev/null
-package com.company;
-
-import java.io.File;
-import java.io.FileInputStream;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathFactory;
-
-import org.w3c.dom.Document;
-
-import java.lang.Integer;
-import java.io.FileReader;
-import java.io.BufferedReader;
-
-public class EsNameParser {
- EsNameParser(){}
-
- static public String esName()
- {
- try {
- FileInputStream file = new FileInputStream(new File(global.listaEsercizi));
- DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
- DocumentBuilder builder = builderFactory.newDocumentBuilder();
- Document xmlDocument = builder.parse(file);
- XPath xPath = XPathFactory.newInstance().newXPath();
- int esNumber = Integer.parseInt(xPath.compile("count(/esercizi/esercizio)").evaluate(xmlDocument));
- String returnValue = null;
- for (int i = 1; i <= esNumber; i++) {
- String name = xPath.compile("/esercizi/esercizio[" + i + "]").evaluate(xmlDocument);
- if (name == null || name.isEmpty())
- continue;
- else {
- if(returnValue==null)
- returnValue=name;
- else
- returnValue = returnValue + "/" + name;
- }
- }
- file.close();
- return returnValue;
- } catch (Exception e) {
- e.printStackTrace();
- }
- return null;
- }
-
- public static boolean check(String esercizio)
- {
- boolean value=false;
- try
- {
- String cartellaEs=global.locationEsercizi;
-
- BufferedReader br = new BufferedReader(new FileReader(cartellaEs+esercizio));
- if (br.readLine() == null) {
- br.close();
- return false;
- }
- FileInputStream file = new FileInputStream(new File(cartellaEs+"/"+esercizio));
- DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
- DocumentBuilder builder = builderFactory.newDocumentBuilder();
- Document xmlDocument = builder.parse(file);
- value=checkFormula(xmlDocument,"/esercizio/tesi/formula[1]");
- if(value)
- value=checkIpotesi(xmlDocument);
- file.close();
- } catch (Exception e) {
- e.printStackTrace();
- }
- return value;
- }
-
- static public boolean checkFormula(Document xmlDocument, String position) {
- try
- {
- XPath xPath = XPathFactory.newInstance().newXPath();
- if(Integer.parseInt(xPath.compile("count(" + position + ")").evaluate(xmlDocument))==1) {
- String type = xPath.compile(position + "/@type").evaluate(xmlDocument);
- int numbOfElements = 5;
- if (type.contentEquals("and") || type.contentEquals("or") || type.contentEquals("impl"))
- numbOfElements = 2;
- else if (type.contentEquals("not"))
- numbOfElements = 1;
- else if (type.contentEquals("literal") || type.contentEquals("atomic"))
- numbOfElements = 0;
- int count = Integer.parseInt(xPath.compile("count(" + position + "/formula)").evaluate(xmlDocument));
- if (count == numbOfElements) {
- if (numbOfElements == 2) {
- boolean firstChild = checkFormula(xmlDocument, position + "/formula[1]");
- boolean secondChild = checkFormula(xmlDocument, position + "/formula[2]");
- if (!firstChild || !secondChild)
- return false;
- else
- return true;
- }
- else if (numbOfElements == 1)
- {
- boolean child = checkFormula(xmlDocument, position + "/formula[1]");
- if (!child)
- return false;
- return true;
- }
- else if (numbOfElements == 0)
- {
- String child = xPath.compile(position).evaluate(xmlDocument);
- if (child == null || child.isEmpty())
- return false;
- else
- return true;
- }
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- return false;
- }
-
- static public boolean checkIpotesi(Document xmlDocument)
- {
- XPath xPath = XPathFactory.newInstance().newXPath();
- boolean returnValue=false;
- try
- {
- int count = Integer.parseInt(xPath.compile("count(/esercizio/ipotesi)").evaluate(xmlDocument));
- int numberHp=Integer.parseInt(xPath.compile("count(/esercizio/ipotesi/formula)").evaluate(xmlDocument));
- if(count==1 && numberHp==0)//se non ci sono ipotesi
- return true;
- for(int i=1;i<=numberHp;i++)
- {
- boolean valore = checkFormula(xmlDocument, "/esercizio/ipotesi/formula["+i+"]");
- if(!valore)
- return false;
- else
- returnValue=true;
- }
- }catch (Exception e) {
- e.printStackTrace();
- }
- return returnValue;
- }
-}
+++ /dev/null
-package com.company;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-
-
-public class MD5 {
-
- MD5(){}
- public static String digest(String filePath) {
- InputStream inputStream = null;
- try {
- inputStream = new FileInputStream(global.locationEsercizi+filePath);
- byte[] buffer = new byte[1024];
- MessageDigest digest = MessageDigest.getInstance("MD5");
- int numRead = 0;
- while (numRead != -1) {
- numRead = inputStream.read(buffer);
- if (numRead > 0)
- digest.update(buffer, 0, numRead);
- }
- byte [] md5Bytes = digest.digest();
- System.out.println(convertHashToString(md5Bytes));
- return convertHashToString(md5Bytes);
- } catch (Exception e) {
- return null;
- } finally {
- if (inputStream != null) {
- try {
- inputStream.close();
- } catch (Exception e) { }
- }
- }
- }
-
- private static String convertHashToString(byte[] md5Bytes) {
- String returnVal = "";
- for (int i = 0; i < md5Bytes.length; i++) {
- returnVal += Integer.toString(( md5Bytes[i] & 0xff ) + 0x100, 16).substring(1);
- }
- return returnVal;
- }
-}
+++ /dev/null
-all:
- javac -cp "/tmp/ext/mysql-connector-java.jar:/tmp/ext/jdom-2.0.5.jar:/tmp/ext/mail-1.4.1.jar:." *.java
+++ /dev/null
-package com.company;
-
-import java.sql.*;
-import java.io.IOException;
-
-import java.math.BigInteger;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-
-import java.util.Random;
-
-import java.sql.Timestamp;
-
-import java.util.ArrayList;
-
-import java.lang.Double;
-
-public class dbConnect
-{
- private static Connection db;
- private static Statement stmt;
- dbConnect()
- {}
-
-
- public static Long time()
- {
- java.util.Date date= new java.util.Date();
- Timestamp now=new Timestamp(date.getTime());
- return now.getTime();
- }
-
- //pulisce confmail e connessi da tutte le richieste maggiori di 10 minuti
- private static void deletetmp() throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException, IOException
- {
- PreparedStatement preparedStmt = db.prepareStatement("DELETE FROM confmail WHERE time<=?");
- preparedStmt.setLong (1,(time()-600000));
- preparedStmt.execute();
- preparedStmt = db.prepareStatement("DELETE FROM connessi WHERE time<=?");
- preparedStmt.setLong (1,(time()-600000));
- preparedStmt.execute();
- }
-
- //divide la stringa in user e password
- private static String splitUsrPass(String userAndPass, int code) throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException, IOException
- {
- String user=null;
- String pass=null;
- ArrayList<String> userPass= suString.stringToArrayList(userAndPass);
- if(userPass.size()>=1)
- user=userPass.get(0);
- if(userPass.size()>=2)
- pass=userPass.get(1);
-
- assert user != null;
- if(!user.contains("@studio.unibo.it") && user.length()<16)
- return "mail-error";
- else {
- assert pass != null;
- if(code==0)
- return registration(user, pass);
- else if(code==1)
- return login(user, pass);
- else if(code==2)
- return recupero(user);
- else
- return "error";
- }
- }
-
- //routin di gestione recupero pass
- private static String recupero(String user) throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException, IOException
- {
- ResultSet returnQuery=stmt.executeQuery("SELECT * FROM utenti where user='"+user+"'");
- if(returnQuery!=null)
- {
- if(returnQuery.next())
- {
- EmailSender email = new EmailSender(global.email,
- global.emailPass,
- "smtp.gmail.com",
- global.email,
- user,
- "OGGETTO: recupero password",
- "la tua password è "+returnQuery.getString("pass"));
- email.inviaEmail();
- return "mail-pass-ok";
- }
- else
- return "user-error";
- }
- else
- return "user-error";
- }
-
-
- //routin di gestione della registrazione
- private static String registration(String user, String pass) throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException, IOException
- {
- String ran;
- ResultSet returnQuery=stmt.executeQuery("SELECT * FROM utenti where user='"+user+"'");
- if(returnQuery!=null)
- {
- if(returnQuery.next())
- {
- if(returnQuery.getString("user").compareTo(user)==0 && returnQuery.getString("pass").compareTo(pass)==0)
- return "già -registrato";
- }
- }
- returnQuery=stmt.executeQuery("SELECT * FROM confmail where user='"+user+"'");
- if(returnQuery!=null)
- {
- if(returnQuery.next())
- {
- ran=returnQuery.getString("hash");
- if(returnQuery.getString("pass").compareTo(pass)!=0)
- {
- PreparedStatement preparedStmt = db.prepareStatement("UPDATE confmail SET pass =? where user=?");
- preparedStmt.setString (1,pass);
- preparedStmt.setString (2,user);
- preparedStmt.execute();
- }
- }
- else
- {
- Random random = new Random();
- ran=String.valueOf(random.nextInt(100000000)+10000000)+String.valueOf(random.nextInt(100000000)+10000000)+String.valueOf(random.nextInt(100000000)+10000000);
- //returnQuery=stmt.executeQuery("INSERT INTO confmail VALUES('"+user+"','"+pass+"',"+hash+"')");
- PreparedStatement preparedStmt = db.prepareStatement("INSERT INTO confmail (user,pass,hash,time) VALUES(?,?,?,?)");
- preparedStmt.setString (1,user);
- preparedStmt.setString (2,pass);
- preparedStmt.setString (3,ran);
- preparedStmt.setDouble (4,(double)time());
- preparedStmt.execute();
- }
- }
- else
- {
- Random random = new Random();
- ran=String.valueOf(random.nextInt(100000000)+10000000)+String.valueOf(random.nextInt(100000000)+10000000)+String.valueOf(random.nextInt(100000000)+10000000);
- //returnQuery=stmt.executeQuery("INSERT INTO confmail VALUES('"+user+"','"+pass+"',"+hash+"')");
- PreparedStatement preparedStmt = db.prepareStatement("INSERT INTO confmail (user,pass,hash,time) VALUES(?,?,?,?)");
- preparedStmt.setString (1,user);
- preparedStmt.setString (2,pass);
- preparedStmt.setString (3,ran);
- preparedStmt.setDouble (4,(double)time());
- preparedStmt.execute();
- }
- EmailSender email = new EmailSender(global.email,
- global.emailPass,
- "smtp.gmail.com",
- global.email,
- user,
- "OGGETTO: Registrazione App",
- "per confermare la tua email clicka sul link: http://"+global.serverName+"/test?id="+ran);
- email.inviaEmail();
- return "mail-reg-ok";
- }
-
- //routin conferma registrazione
- private static String confirmRegistration(String hash) throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException, IOException
- {
- ResultSet returnQuery=stmt.executeQuery("SELECT * FROM confmail where hash='"+hash+"'");
- if(returnQuery!=null)
- {
- if(returnQuery.next())
- {
- PreparedStatement preparedStmt = db.prepareStatement("INSERT INTO utenti (user,pass) VALUES(?,?)");
- preparedStmt.setString (1,returnQuery.getString("user"));
- preparedStmt.setString (2,returnQuery.getString("pass"));
- preparedStmt.execute();
- preparedStmt = db.prepareStatement("DELETE FROM confmail WHERE hash=?");
- preparedStmt.setString (1,hash);
- preparedStmt.execute();
- return "registrazione-ok";
- }
- }
- return "registrazione-error";
- }
-
- //routin di gestione login
- private static String login(String user, String pass) throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException, IOException
- {
-
- ResultSet returnQuery=stmt.executeQuery("SELECT * FROM utenti where user='"+user+"' and pass='"+pass+"'");
- if(returnQuery!=null)
- {
- if(returnQuery.next())
- {
- if(returnQuery.getString("user").compareTo(user)==0 && returnQuery.getString("pass").compareTo(pass)==0)
- return putConnessi(user);
- }
- }
- return "login-error";
- }
-
-
- //informazioni sulla connessione dell'utente
- private String infoConnessi(String message) throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException, IOException
- {
- ArrayList<String> split= suString.stringToArrayList(message);
- if(split.size()>=1)
- {
- ResultSet returnQuery=stmt.executeQuery("SELECT * FROM connessi WHERE tempkey='"+split.get(1)+"'");
- if(returnQuery!=null)
- {
- if(returnQuery.next())
- {
- return "loggato";
- }
- }
- }
- return "request-login";
- }
-
- //inserisce l'utente in connessi
- private static String putConnessi(String user) throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException, IOException
- {
- Random random = new Random();
- String ran=String.valueOf(random.nextInt(100000000)+10000000)+String.valueOf(random.nextInt(100000000)+10000000);
- PreparedStatement preparedStmt = db.prepareStatement("INSERT INTO connessi (user,tempkey,thread,time) VALUES(?,?,?,?)");
- preparedStmt.setString (1,user);
- preparedStmt.setString (2,ran);
- preparedStmt.setBoolean (3,false);
- preparedStmt.setDouble (4,(double)time());
- preparedStmt.execute();
- return ran;
- }
-
- //segnalare morte di un thread
- private String threadDead(String key) throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException, IOException
- {
- PreparedStatement preparedStmt = db.prepareStatement("DELETE FROM confmail WHERE tempkey=?");
- preparedStmt.setString (1,key);
- preparedStmt.execute();
- return "kill-ok";
- }
-
- //remposta il rimer dell'utente nella tabella connessi
- private String connessiTimer(String key) throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException, IOException
- {
- PreparedStatement preparedStmt = db.prepareStatement("UPDATE connessi SET time =? where tempkey=?");
- preparedStmt.setDouble (1,(double)time());
- preparedStmt.setString (2,key);
- preparedStmt.execute();
- return "timer-settato";
- }
-
- private String exerciseAccept(String request) throws SQLException, IOException, NoSuchAlgorithmException {
- ArrayList<String> input=suString.stringToArrayList(request);
- ResultSet returnQuery=stmt.executeQuery("SELECT * FROM connessi where tempkey='"+input.get(0)+"'");
- String utente=null;
- if(returnQuery!=null)
- {
- if(returnQuery.next())
- utente=returnQuery.getString("user");
- }
- if(utente!=null)
- {
- String[] esercizi=suString.stringToVectorString(EsNameParser.esName());
- for(String esercizio : esercizi)
- {
- if(esercizio.contentEquals(input.get(1)))//se l'esercizio esiste
- {
- if(MD5.digest(esercizio).contentEquals(input.get(2)))//se il digest è uguale
- {
- PreparedStatement preparedStmt = db.prepareStatement("INSERT INTO esercizi (esercizio,utente,click,time) VALUES(?,?,?,?)");
- preparedStmt.setDouble(4, Double.parseDouble(input.get(3)));
- preparedStmt.setInt (3,Integer.valueOf(input.get(4)));
- preparedStmt.setString (2,utente);
- preparedStmt.setString (1,input.get(1));
- preparedStmt.execute();
- return "es-ok";
- }
- }
- }
- }
- return "es-err";
- }
-
- private String userExercise(String request) throws SQLException {
- ArrayList<String> arrayResult=new ArrayList<String>();
- ArrayList<String> input=suString.stringToArrayList(request);
- String result=null;
- ResultSet returnQuery=stmt.executeQuery("SELECT * FROM connessi where tempkey='"+input.get(0)+"'");
- String utente=null;
- if(returnQuery!=null)
- {
- if(returnQuery.next())
- utente=returnQuery.getString("user");
- }
- if(utente!=null)
- {
- returnQuery=stmt.executeQuery("SELECT * FROM esercizi where utente='"+utente+"'");
- while(returnQuery.next())
- {
- arrayResult.add(returnQuery.getString("esercizio")+"/"+MD5.digest(returnQuery.getString("esercizio"))+"/"+returnQuery.getDouble("time")+"/"+returnQuery.getInt("click"));
- }
- result=suString.multiToString(arrayResult);
- }
- return result;
- }
-
- private String cambiaPass(String request) throws ClassNotFoundException, SQLException, InstantiationException, IOException, IllegalAccessException {
- ArrayList<String> input=suString.stringToArrayList(request);
- if(input.size()>=3) {
- String result = login(input.get(0), input.get(1));
- if(!result.contains("err"))
- {
- PreparedStatement preparedStmt = db.prepareStatement("UPDATE utenti SET pass =? where user=?");
- preparedStmt.setString (1,input.get(2));
- preparedStmt.setString (2,input.get(0));
- preparedStmt.execute();
- return "cambiata";
- }
- }
- return "error";
- }
-
- public String dbQuery(String input) throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException, IOException, NoSuchAlgorithmException {
- Class.forName("com.mysql.jdbc.Driver").newInstance();
- db = DriverManager.getConnection("jdbc:mysql://localhost/logintesi", "root", "csc@CerCo!");
- stmt = db.createStatement();
- deletetmp();
- if (input.charAt(0) == '0')
- return splitUsrPass(input.substring(2), 0);
- else if (input.charAt(0) == '1')
- return splitUsrPass(input.substring(2), 1);
- else if (input.charAt(0) == '2')
- return recupero(input.substring(2));
- else if (input.charAt(0) == '3')
- return confirmRegistration(input.substring(1));
- else if (input.charAt(0) == '4')
- return EsNameParser.esName();
- else if (input.charAt(0) == '5')
- return infoConnessi(input.substring(2));
- else if (input.charAt(0) == '6')
- return connessiTimer(input.substring(2));
- /*else if (input.charAt(0) == '7')
- return threadDead(input.substring(2));*/
- /*else if(input.charAt(0)=='8')
- return aggToClient(input.substring(2));
- else if(input.charAt(0)=='9')
- return aggForClient(input.substring(2));
- else if(input.charAt(0)=='a' && input.charAt(1)=='0')
- return check(input.substring(3));*/
- else if (input.charAt(0) == '8')
- return exerciseAccept(input.substring(2));
- else if (input.charAt(0) == '9')
- return userExercise(input.substring(2));
- else if(input.charAt(0)=='a' && input.charAt(1)=='0')
- return cambiaPass(input.substring(3));
- return "error";
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<esercizi>\r
- <esercizio md5="e687f326a904946f498421a0409916bf">aalbero.xml</esercizio>\r
- <esercizio md5="d3d4772339c39d408a1b92a24d3c9311">tautologia.xml</esercizio>\r
- <esercizio md5="2a54f15678d8b0fa3b2d1f3824dfd7b6">demorgan.xml</esercizio>\r
- <esercizio md5="4bfe78fb51248594a8b98ba51eff769f">triviale.xml</esercizio>\r
- <esercizio md5="97c0cdde7504597040d100cfe3aa1644">test.xml</esercizio>\r
- <esercizio md5="3c217b2132e40729b6c56c39073a356a">risolvibile.xml</esercizio>\r
- <esercizio md5="62b5ca97fbf8a5845185ae6010e26828">demorgan2.xml</esercizio>\r
-</esercizi>\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\r
-<esercizi>\r
- <esercizio>aalbero.xml</esercizio>\r
-</esercizi>\r
+++ /dev/null
-package com.company;
-
-
-public class global {
- public static final String listaEsercizi="/projects/logicplayer/Server/server/tesi/src/com/company/esercizi.xml";
- public static final String locationEsercizi="/projects/logicplayer/public_html/esercizi/";
- public static String home="/projects/logicplayer/Server/server/tesi/src/com/company/";
- public static String keyStorePass="123456";
- public static String keyStoreName="keystore.jks";
- public static String serverName="130.136.129.1";
- public static String email="confermaiscrizioneserver@gmail.com";
- public static String emailPass="tes6phev8n";
- public static int portaServer=25000;
- public static int portaHttpServer=8000;
-
-}
+++ /dev/null
-package com.company;
-
-import java.io.*;
-
-import javax.net.ssl.*;
-
-class guestServer implements Runnable
-{
- private SSLSocket socket;
-
- guestServer(SSLSocket client)
- {
- socket=client;
- }
-
- public void run()
- {
- try
- {
-
- //Reading the message from the client
- InputStream is = socket.getInputStream();
- InputStreamReader isr = new InputStreamReader(is);
- BufferedReader br = new BufferedReader(isr);
- String requestMessage = br.readLine();
- System.out.println("ho ricevuto: "+requestMessage);
- /*System.out.println("Message received from client is "+returnMessage);
- dbConnect request=new dbConnect();
- String returnQuery=request.dbQuery(returnMessage);
- OutputStream os = socket.getOutputStream();
- OutputStreamWriter osw = new OutputStreamWriter(os);
- BufferedWriter bw = new BufferedWriter(osw);
- System.out.println(returnQuery);
- bw.write(returnQuery+"\n");
- bw.flush();*/
- if(requestMessage!=null)
- {
- dbConnect request = new dbConnect();
- String returnQuery;
- if ( requestMessage.charAt(0) == '0' ||
- requestMessage.charAt(0) == '1' ||
- requestMessage.charAt(0) == '2' ||
- (requestMessage.charAt(0) == 'a' && requestMessage.charAt(1) == '0')) {
- returnQuery = request.dbQuery(requestMessage);
- OutputStream os = socket.getOutputStream();
- OutputStreamWriter osw = new OutputStreamWriter(os);
- BufferedWriter bw = new BufferedWriter(osw);
- bw.write(returnQuery + "\n");
- bw.flush();
- System.out.println("ho inviato: " + returnQuery);
- }
- else
- {
- returnQuery = request.dbQuery("5/" + requestMessage);
- if (returnQuery.contains("request-login") || returnQuery.contains("request-error"))
- {
- OutputStream os = socket.getOutputStream();
- OutputStreamWriter osw = new OutputStreamWriter(os);
- BufferedWriter bw = new BufferedWriter(osw);
- bw.write(returnQuery + "\n");
- bw.flush();
- System.out.println("ho inviato: " + returnQuery);
- }
- else if (returnQuery.contains("loggato"))
- {
- personalServer nuovaConnessione = new personalServer(socket, requestMessage);
- Thread t = new Thread(nuovaConnessione);
- t.start();
- }
- }
- }
-
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
-
- }
-}
+++ /dev/null
-package com.company;
-
-import java.io.*;
-import java.net.*;
-import java.security.NoSuchAlgorithmException;
-import java.util.*;
-
-import com.sun.net.httpserver.HttpExchange;
-import com.sun.net.httpserver.HttpHandler;
-import com.sun.net.httpserver.HttpServer;
-import java.sql.*;
-
-public class httpget implements Runnable {
-
- httpget(){}
-
- public static Map<String, String> splitQuery(String query) throws UnsupportedEncodingException
- {
- Map<String, String> query_pairs = new LinkedHashMap<String, String>();
- String[] pairs = query.split("&");
- for (String pair : pairs)
- {
- int idx = pair.indexOf("=");
- query_pairs.put(URLDecoder.decode(pair.substring(0, idx), "UTF-8"), URLDecoder.decode(pair.substring(idx + 1), "UTF-8"));
- }
- return query_pairs;
- }
-
- @Override
- public void run() {
- try {
- HttpServer server = HttpServer.create(new InetSocketAddress(global.portaHttpServer), 0);
- server.createContext("/test", new MyHandler());
- server.setExecutor(null); // creates a default executor
- server.start();
- }catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- static class MyHandler implements HttpHandler
- {
- public void handle(HttpExchange t) throws IOException
- {
-
- /*String response = "This is the response";
- System.out.println("mannaggia santa");
- t.sendResponseHeaders(200, response.length());
- OutputStream os = t.getResponseBody();
- os.write(response.getBytes());*/
- URI req=t.getRequestURI();
- String query=req.getQuery();
- Map<String, String> result=splitQuery(query);
- String id=result.get("id");
- //System.out.println(id);
- try
- {
- dbConnect request=new dbConnect();
- String returnQuery=request.dbQuery("3"+id);
- t.sendResponseHeaders(200, returnQuery.length());
- OutputStream os = t.getResponseBody();
- os.write(returnQuery.getBytes());
- os.close();
- }
- catch(SQLException e)
- {}
- catch(ClassNotFoundException c)
- {}
- catch(IllegalAccessException a)
- {}
- catch(InstantiationException i)
- {} catch (NoSuchAlgorithmException e) {
- e.printStackTrace();
- }
- }
- }
-
-}
+++ /dev/null
-package com.company;
-
-import java.io.BufferedWriter;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-
-import javax.net.ssl.*;
-
-
-import java.util.ArrayList;
-
-class personalServer implements Runnable
-{
- private SSLSocket socket;
- private String key;
- private String requestMessage;
-
- personalServer(SSLSocket client, String message)
- {
- socket=client;
- ArrayList<String> split= suString.stringToArrayList(message);
- key=split.get(1);
- requestMessage=message;
- }
-
- public void run()
- {
- try
- {
- dbConnect request=new dbConnect();
- String returnQuery=request.dbQuery(requestMessage);
- OutputStream os = socket.getOutputStream();
- OutputStreamWriter osw = new OutputStreamWriter(os);
- BufferedWriter bw = new BufferedWriter(osw);
- bw.write(returnQuery+"\n");
- bw.flush();
- System.out.println("ho inviato: "+returnQuery);
- request.dbQuery("6/"+key);
- socket.close();
- }
- catch (Exception e)
- {
- try
- {
- e.printStackTrace();
- dbConnect request=new dbConnect();
- request.dbQuery("7/"+key);
- }
- catch (Exception k)
- {
- //k.printStackTrace();
- System.out.println("PANIC!");
- }
- }
- }
-}
+++ /dev/null
-package com.company;
-
-import java.util.ArrayList;
-import java.util.Collections;
-
-public class suString
-{
- suString()
- {}
-
-
- public static ArrayList<String> stringToArrayList(String string)
- {
- ArrayList<String> returnValue=new ArrayList<String>();
- int j=0;
- for(int i=0;i<string.length();i++)
- {
- if(string.charAt(i)=='/')
- {
- returnValue.add(string.substring(j,i));
- j=i+1;
- }
- else if(i==string.length()-1)
- returnValue.add(string.substring(j));
- }
- return returnValue;
- }
-
- public static ArrayList<String> vectorStringToArrayList(String[] vectorString)
- {
- ArrayList<String> returnValue=new ArrayList<String>();
- Collections.addAll(returnValue, vectorString);
- return returnValue;
- }
-
- public static String arrayListToString (ArrayList<String> arraylist)
- {
- String returnValue= "";
- for(int i=0;i<arraylist.size();i++)
- {
- if(i<arraylist.size()-1)
- returnValue=returnValue+arraylist.get(i)+"/";
- else
- returnValue=returnValue+arraylist.get(i);
- }
- return returnValue;
- }
-
- public static String vectorStringToString(String[] vectorString)
- {
- return arrayListToString(vectorStringToArrayList(vectorString));
- }
-
- public static String[] arrayListToVectorString (ArrayList<String> arraylist)
- {
- String[] returnValue=new String[arraylist.size()];
- for(int i=0;i<arraylist.size();i++)
- returnValue[i]=arraylist.get(i);
- return returnValue;
- }
-
- public static String[] stringToVectorString(String string)
- {
- return arrayListToVectorString(stringToArrayList(string));
- }
-
- public static String multiToString(ArrayList<String> input)
- {
- String returnValue=null;
- int size=input.size();
- for(int i=0;i<size;i++)
- {
- if(i==0)
- returnValue=input.get(i);
- else
- returnValue=returnValue+"//"+input.get(i);
- }
- return returnValue;
- }
-
- public static ArrayList<String> stringToMultiArray(String input)
- {
- ArrayList<String> result=new ArrayList<String>();
- int j=0;
- for(int i=0;i<input.length();i++)
- {
- if(input.charAt(i)=='/') {
- if (input.charAt(i + 1) == '/') {
- result.add(input.substring(j, i));
- j=i+2;
- }
- }
- }
- return result;
- }
-}
+++ /dev/null
-package com.company;
-
-import java.io.*;
-import java.lang.Thread;
-import java.security.*;
-import javax.net.ssl.*;
-
-import java.nio.file.FileSystems;
-import java.nio.file.Path;
-
-
-class superServer
-{
- public static void main(String[] args)
- {
- String ksName = global.home+global.keyStoreName;
- char ksPass[] = global.keyStorePass.toCharArray();
- char ctPass[] = global.keyStorePass.toCharArray();
-
- //thread di controllo directory esercizi
- Path pathToWatch = FileSystems.getDefault().getPath(global.locationEsercizi);
- DirectoryWatcher dirWatcher = new DirectoryWatcher(pathToWatch);
- Thread dirWatcherThread = new Thread(dirWatcher);
- dirWatcherThread.start();
-
- //thread che si occupa del lato http
- httpget regServer=new httpget();
- Thread httpServer=new Thread(regServer);
- httpServer.start();
-
- while(true)
- {
- try
- {
- KeyStore ks = KeyStore.getInstance("JKS");
- ks.load(new FileInputStream(ksName), ksPass);
- KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
- kmf.init(ks, ctPass);
- SSLContext sc = SSLContext.getInstance("TLS");
- sc.init(kmf.getKeyManagers(), null, null);
- SSLServerSocketFactory ssf = sc.getServerSocketFactory();
- SSLServerSocket s= (SSLServerSocket) ssf.createServerSocket(global.portaServer);
- System.out.println("Server started:");
- while(true)
- {
- SSLSocket c = (SSLSocket) s.accept();
- System.out.println("CSC: debug 1");
- guestServer guest=new guestServer(c);
- Thread t=new Thread(guest);
- t.start();
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- }
-}
+++ /dev/null
-package com.company;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.security.NoSuchAlgorithmException;
-
-import org.jdom2.Document;
-import org.jdom2.Element;
-import org.jdom2.JDOMException;
-import org.jdom2.input.SAXBuilder;
-import org.jdom2.output.Format;
-import org.jdom2.output.XMLOutputter;
-
-
-public class xmlOperation {
-
- xmlOperation(){}
- static private String pathName=global.listaEsercizi;
-
- public void create() {
-
- try {
-
- Element company = new Element("esercizi");
- Document doc = new Document(company);
- doc.setRootElement(company);
-
- // new XMLOutputter().output(doc, System.out);
- XMLOutputter xmlOutput = new XMLOutputter();
-
- // display nice nice
- xmlOutput.setFormat(Format.getPrettyFormat());
- xmlOutput.output(doc, new FileWriter(pathName));
-
- System.out.println("File Saved!");
- } catch (IOException io) {
- System.out.println(io.getMessage());
- }
- }
-
-
-
- public void add(String name)
- {
- try {
-
- SAXBuilder builder = new SAXBuilder();
- File xmlFile = new File(pathName);
-
- Document doc = (Document) builder.build(xmlFile);
- Element rootNode = doc.getRootElement();
-
-
- // add new age element
- Element newEs = new Element("esercizio").setText(name).setAttribute("md5",MD5.digest(name));
- rootNode.addContent(newEs);
-
- XMLOutputter xmlOutput = new XMLOutputter();
-
- // display nice nice
- xmlOutput.setFormat(Format.getPrettyFormat());
- xmlOutput.output(doc, new FileWriter(pathName));
-
- // xmlOutput.output(doc, System.out);
-
- System.out.println("File updated!");
- } catch (IOException io) {
- io.printStackTrace();
- } catch (JDOMException e) {
- e.printStackTrace();
- }
- }
-
- public String getMD5(String name)
- {
- try {
-
- SAXBuilder builder = new SAXBuilder();
- File xmlFile = new File(pathName);
-
- Document doc = (Document) builder.build(xmlFile);
- Element rootNode = doc.getRootElement();
-
- for(Element esercizio:rootNode.getChildren())
- {
- if(esercizio.getText().contentEquals(name))
- {
- return esercizio.getAttribute("md5").toString();
- }
- }
- } catch (IOException io) {
- io.printStackTrace();
- } catch (JDOMException e) {
- e.printStackTrace();
- }
- return null;
- }
-
- public void remove(String name)
- {
- try {
-
- SAXBuilder builder = new SAXBuilder();
- File xmlFile = new File(pathName);
-
- Document doc = (Document) builder.build(xmlFile);
- Element rootNode = doc.getRootElement();
-
- for(Element esercizio:rootNode.getChildren())
- {
- if(esercizio.getText().contentEquals(name))
- {
- System.out.println("trovato");
- rootNode.removeContent(esercizio);
- }
- }
-
- XMLOutputter xmlOutput = new XMLOutputter();
-
- // display nice nice
- xmlOutput.setFormat(Format.getPrettyFormat());
- xmlOutput.output(doc, new FileWriter(pathName));
-
- // xmlOutput.output(doc, System.out);
-
- System.out.println("File updated!");
- } catch (IOException io) {
- io.printStackTrace();
- } catch (JDOMException e) {
- e.printStackTrace();
- }
- }
-
-
-}
+++ /dev/null
-#!/bin/bash
-
-java -cp "/tmp/ext/mysql-connector-java.jar:/tmp/ext/jdom-2.0.5.jar:/tmp/ext/mail-1.4.1.jar:." com.company.superServer
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<module type="JAVA_MODULE" version="4">
- <component name="NewModuleRootManager" inherit-compiler-output="true">
- <exclude-output />
- <content url="file://$MODULE_DIR$">
- <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
- </content>
- <orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
- <orderEntry type="sourceFolder" forTests="false" />
- </component>
-</module>
\ No newline at end of file