]> matita.cs.unibo.it Git - logicplayer.git/commitdiff
new initial commit
authorwww-data <www-data@lahar.helm.cs.unibo.it>
Tue, 2 Dec 2014 10:24:48 +0000 (11:24 +0100)
committerwww-data <www-data@lahar.helm.cs.unibo.it>
Tue, 2 Dec 2014 10:24:48 +0000 (11:24 +0100)
138 files changed:
Server/JOURNAL [new file with mode: 0644]
Server/logintesi.sql [new file with mode: 0644]
Server/server/tesi/.idea/compiler.xml [new file with mode: 0644]
Server/server/tesi/.idea/copyright/profiles_settings.xml [new file with mode: 0644]
Server/server/tesi/.idea/description.html [new file with mode: 0644]
Server/server/tesi/.idea/encodings.xml [new file with mode: 0644]
Server/server/tesi/.idea/misc.xml [new file with mode: 0644]
Server/server/tesi/.idea/modules.xml [new file with mode: 0644]
Server/server/tesi/.idea/project-template.xml [new file with mode: 0644]
Server/server/tesi/.idea/scopes/scope_settings.xml [new file with mode: 0644]
Server/server/tesi/.idea/uiDesigner.xml [new file with mode: 0644]
Server/server/tesi/.idea/vcs.xml [new file with mode: 0644]
Server/server/tesi/.idea/workspace.xml [new file with mode: 0644]
Server/server/tesi/out/production/tesi/com/company/DirectoryWatcher.class [new file with mode: 0644]
Server/server/tesi/out/production/tesi/com/company/EmailSender.class [new file with mode: 0644]
Server/server/tesi/out/production/tesi/com/company/EsNameParser.class [new file with mode: 0644]
Server/server/tesi/out/production/tesi/com/company/MD5.class [new file with mode: 0644]
Server/server/tesi/out/production/tesi/com/company/dbConnect.class [new file with mode: 0644]
Server/server/tesi/out/production/tesi/com/company/esercizi.xml [new file with mode: 0644]
Server/server/tesi/out/production/tesi/com/company/global.class [new file with mode: 0644]
Server/server/tesi/out/production/tesi/com/company/guestServer.class [new file with mode: 0644]
Server/server/tesi/out/production/tesi/com/company/httpget$MyHandler.class [new file with mode: 0644]
Server/server/tesi/out/production/tesi/com/company/httpget.class [new file with mode: 0644]
Server/server/tesi/out/production/tesi/com/company/keystore.bks [new file with mode: 0644]
Server/server/tesi/out/production/tesi/com/company/keystore.crt [new file with mode: 0644]
Server/server/tesi/out/production/tesi/com/company/keystore.jks [new file with mode: 0644]
Server/server/tesi/out/production/tesi/com/company/personalServer.class [new file with mode: 0644]
Server/server/tesi/out/production/tesi/com/company/suString.class [new file with mode: 0644]
Server/server/tesi/out/production/tesi/com/company/superServer.class [new file with mode: 0644]
Server/server/tesi/out/production/tesi/com/company/xmlOperation.class [new file with mode: 0644]
Server/server/tesi/out/production/testi/com/company/DeleteFileExample.class [new file with mode: 0644]
Server/server/tesi/out/production/testi/com/company/EmailSender.class [new file with mode: 0644]
Server/server/tesi/out/production/testi/com/company/EsNameParser.class [new file with mode: 0644]
Server/server/tesi/out/production/testi/com/company/dbConnect.class [new file with mode: 0644]
Server/server/tesi/out/production/testi/com/company/esercizi.xml [new file with mode: 0644]
Server/server/tesi/out/production/testi/com/company/guestServer.class [new file with mode: 0644]
Server/server/tesi/out/production/testi/com/company/httpget$MyHandler.class [new file with mode: 0644]
Server/server/tesi/out/production/testi/com/company/httpget.class [new file with mode: 0644]
Server/server/tesi/out/production/testi/com/company/keystore.bks [new file with mode: 0644]
Server/server/tesi/out/production/testi/com/company/keystore.crt [new file with mode: 0644]
Server/server/tesi/out/production/testi/com/company/keystore.jks [new file with mode: 0644]
Server/server/tesi/out/production/testi/com/company/personalServer.class [new file with mode: 0644]
Server/server/tesi/out/production/testi/com/company/suString.class [new file with mode: 0644]
Server/server/tesi/out/production/testi/com/company/superServer.class [new file with mode: 0644]
Server/server/tesi/src/com/company/DeleteFileExample.class [new file with mode: 0644]
Server/server/tesi/src/com/company/DirectoryWatcher.class [new file with mode: 0644]
Server/server/tesi/src/com/company/DirectoryWhatcer.java [new file with mode: 0644]
Server/server/tesi/src/com/company/EmailSender.class [new file with mode: 0644]
Server/server/tesi/src/com/company/EmailSender.java [new file with mode: 0644]
Server/server/tesi/src/com/company/EsNameParser.class [new file with mode: 0644]
Server/server/tesi/src/com/company/EsNameParser.java [new file with mode: 0644]
Server/server/tesi/src/com/company/MD5.class [new file with mode: 0644]
Server/server/tesi/src/com/company/MD5.java [new file with mode: 0644]
Server/server/tesi/src/com/company/Makefile [new file with mode: 0644]
Server/server/tesi/src/com/company/dbConnect.class [new file with mode: 0644]
Server/server/tesi/src/com/company/dbConnect.java [new file with mode: 0644]
Server/server/tesi/src/com/company/esercizi.xml [new file with mode: 0644]
Server/server/tesi/src/com/company/esercizi.xml~ [new file with mode: 0644]
Server/server/tesi/src/com/company/global.class [new file with mode: 0644]
Server/server/tesi/src/com/company/global.java [new file with mode: 0644]
Server/server/tesi/src/com/company/guestServer.class [new file with mode: 0644]
Server/server/tesi/src/com/company/guestServer.java [new file with mode: 0644]
Server/server/tesi/src/com/company/httpget$MyHandler.class [new file with mode: 0644]
Server/server/tesi/src/com/company/httpget.class [new file with mode: 0644]
Server/server/tesi/src/com/company/httpget.java [new file with mode: 0644]
Server/server/tesi/src/com/company/keystore.bks [new file with mode: 0644]
Server/server/tesi/src/com/company/keystore.crt [new file with mode: 0644]
Server/server/tesi/src/com/company/keystore.jks [new file with mode: 0644]
Server/server/tesi/src/com/company/personalServer.class [new file with mode: 0644]
Server/server/tesi/src/com/company/personalServer.java [new file with mode: 0644]
Server/server/tesi/src/com/company/suString.class [new file with mode: 0644]
Server/server/tesi/src/com/company/suString.java [new file with mode: 0644]
Server/server/tesi/src/com/company/superServer.class [new file with mode: 0644]
Server/server/tesi/src/com/company/superServer.java [new file with mode: 0644]
Server/server/tesi/src/com/company/testEsname.class [new file with mode: 0644]
Server/server/tesi/src/com/company/xmlOperation.class [new file with mode: 0644]
Server/server/tesi/src/com/company/xmlOperation.java [new file with mode: 0644]
Server/server/tesi/src/go.sh [new file with mode: 0755]
Server/server/tesi/tesi.iml [new file with mode: 0644]
Server/webApp/.prova.php.swp [new file with mode: 0644]
Server/webApp/esercizi/aalbero.xml [new file with mode: 0644]
Server/webApp/esercizi/demorgan.xml [new file with mode: 0644]
Server/webApp/esercizi/demorgan2.xml [new file with mode: 0644]
Server/webApp/esercizi/risolvibile.xml [new file with mode: 0644]
Server/webApp/esercizi/tautologia.xml [new file with mode: 0644]
Server/webApp/esercizi/test.xml [new file with mode: 0644]
Server/webApp/index.html [new file with mode: 0755]
Server/webApp/index.html~ [new file with mode: 0755]
Server/webApp/login.css [new file with mode: 0755]
Server/webApp/login.js [new file with mode: 0755]
Server/webApp/login.js~ [new file with mode: 0755]
Server/webApp/login.php [new file with mode: 0755]
Server/webApp/login.php~ [new file with mode: 0755]
Server/webApp/logout.js [new file with mode: 0755]
Server/webApp/logout.php [new file with mode: 0755]
Server/webApp/main.php [new file with mode: 0755]
Server/webApp/printEs.php [new file with mode: 0755]
Server/webApp/prova.html~ [new file with mode: 0755]
Server/webApp/prova.js [new file with mode: 0755]
Server/webApp/prova.pho [new file with mode: 0755]
Server/webApp/prova.pho~ [new file with mode: 0755]
Server/webApp/prova.php [new file with mode: 0755]
Server/webApp/prova.php~ [new file with mode: 0755]
Server/webApp/prova.txt [new file with mode: 0755]
Server/webApp/prova.txt~ [new file with mode: 0755]
Server/webApp/serverRequest.php [new file with mode: 0755]
Server/webApp/upload.php [new file with mode: 0755]
Server/webApp/upload.php~ [new file with mode: 0755]
Server/webApp/util.php [new file with mode: 0755]
Server/webApp/xmlPharse.php [new file with mode: 0755]
public_html/esercizi/demorgan2.xml [new file with mode: 0644]
public_html/esercizi/risolvibile.xml [new file with mode: 0644]
public_html/esercizi/test.xml [new file with mode: 0644]
public_html/esercizi/triviale.xml [new file with mode: 0644]
public_html/index.html [new file with mode: 0755]
public_html/index.html~ [new file with mode: 0755]
public_html/login.css [new file with mode: 0755]
public_html/login.js [new file with mode: 0755]
public_html/login.js~ [new file with mode: 0755]
public_html/login.php [new file with mode: 0755]
public_html/login.php~ [new file with mode: 0755]
public_html/logout.js [new file with mode: 0755]
public_html/logout.php [new file with mode: 0755]
public_html/main.php [new file with mode: 0755]
public_html/printEs.php [new file with mode: 0755]
public_html/prova.html~ [new file with mode: 0755]
public_html/prova.js [new file with mode: 0755]
public_html/prova.pho [new file with mode: 0755]
public_html/prova.pho~ [new file with mode: 0755]
public_html/prova.php [new file with mode: 0755]
public_html/prova.php~ [new file with mode: 0755]
public_html/prova.txt [new file with mode: 0755]
public_html/prova.txt~ [new file with mode: 0755]
public_html/serverRequest.php [new file with mode: 0755]
public_html/upload.php [new file with mode: 0755]
public_html/upload.php~ [new file with mode: 0755]
public_html/util.php [new file with mode: 0755]
public_html/xmlPharse.php [new file with mode: 0755]

diff --git a/Server/JOURNAL b/Server/JOURNAL
new file mode 100644 (file)
index 0000000..9714212
--- /dev/null
@@ -0,0 +1,28 @@
+### Librerie ###
+- installare: apache, php5, php5-mysql, mysql-server, openjdk-8-jdk
+
+### Database ###
+- aggiungere a logintesi.sql USE logintesi; se non c'e'
+- mysql -u root -p
+  create database logintesi;
+- mysql < ~claudio/tesi_applet/logintesi.sql -u root -p
+
+### Php server ###
+- mkdir Server && cd Server && tar -zxvf ../Server.tar.gz
+- cp -R ~claudio/tesi_applet/Server/webApp/* /var/www/html/
+- chown -R www-data:www-data esercizi
+- serverRequest.php: /localhost,  impostare password
+- login.php: /localhost,  impostare password
+- username e password admin sono nel db, tabella admin
+  mysql -u root -p logintesi
+  mysql> insert into admin values("admin","AdMin#@");
+- xmlPharse.php: ~claudio/tesi_applet/Server/server/tesi/src/com/company/esercizi.xml
+
+### Java server ###
+- vim ~/tesi_applet/Server/server/tesi/src/com/company/global.java
+  editare home, servername, ...
+- cp ~claudio/tesi_applet/Server/java-8-oracle/jre/lib/ext/* /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/
+  PERCHE' IL CLASSPATH NON FUNZIONA??
+- javac *.java
+- cd /home/claudio/tesi_applet/Server/server/tesi/src
+  java com.company.superServer
diff --git a/Server/logintesi.sql b/Server/logintesi.sql
new file mode 100644 (file)
index 0000000..ec57f9c
--- /dev/null
@@ -0,0 +1,195 @@
+-- phpMyAdmin SQL Dump
+-- version 4.0.10deb1
+-- http://www.phpmyadmin.net
+--
+-- Host: localhost
+-- Generato il: Nov 14, 2014 alle 16:45
+-- Versione del server: 5.5.38-0ubuntu0.14.04.1
+-- Versione PHP: 5.5.9-1ubuntu4.4
+
+USE logintesi;
+
+SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
+SET time_zone = "+00:00";
+
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+
+--
+-- Database: `logintesi`
+--
+
+-- --------------------------------------------------------
+
+--
+-- Struttura della tabella `admin`
+--
+
+CREATE TABLE IF NOT EXISTS `admin` (
+  `username` varchar(30) COLLATE utf8_bin NOT NULL,
+  `password` varchar(30) COLLATE utf8_bin NOT NULL,
+  UNIQUE KEY `username` (`username`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+
+--
+-- Dump dei dati per la tabella `admin`
+--
+
+INSERT INTO `admin` (`username`, `password`) VALUES
+('danilo.berardinelli', '123stella');
+
+-- --------------------------------------------------------
+
+--
+-- Struttura della tabella `aggprova`
+--
+
+CREATE TABLE IF NOT EXISTS `aggprova` (
+  `chiave` varchar(50) COLLATE utf8_bin NOT NULL,
+  `time` double NOT NULL,
+  `checks` int(11) NOT NULL,
+  PRIMARY KEY (`chiave`),
+  UNIQUE KEY `key` (`chiave`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+
+--
+-- Dump dei dati per la tabella `aggprova`
+--
+
+INSERT INTO `aggprova` (`chiave`, `time`, `checks`) VALUES
+('10157426982320510', 1415145803639, 1),
+('10244937857444543', 1415284664538, 1),
+('10308106918353456', 1415243065790, 1),
+('10385651273134167', 1415289922479, 1),
+('10414239987472834', 1415285560312, 1),
+('1097785784725414', 1415284853312, 1),
+('10983265112121106', 1415242393295, 1),
+('1286713061377424', 1415036978051, 1),
+('1408285479764558', 1415278883075, 1),
+('1490801371315190', 1415285333816, 1),
+('1741331087669285', 1415811578318, 1),
+('18516070104459806', 1415276863684, 1),
+('2217380018747176', 1415145507080, 1),
+('2260502250327125', 1415284745047, 1),
+('2473377684156933', 1415284628252, 1),
+('2504043195911198', 1415285115955, 1),
+('2686774762838581', 1415278911038, 1),
+('2744239278608085', 1415036291300, 1),
+('2956509786688513', 1415271435934, 1),
+('2961042458190883', 1415277033282, 1),
+('3109253928772677', 1415284540445, 1),
+('3311335330604631', 1415237862686, 1),
+('3486758220086141', 1415242975878, 1),
+('3571361357113219', 1415285156048, 1),
+('4091389111256716', 1415025754182, 1),
+('42848425102166715', 1415242068918, 1),
+('4457124515989723', 1415811050681, 1),
+('4577865146663611', 1415285170075, 1),
+('4796791993070257', 1415288554998, 1),
+('5005653368852396', 1415285312682, 1),
+('5226217037177487', 1415145721770, 1),
+('5308112899337743', 1415037335958, 1),
+('5362524692721963', 1415811381242, 1),
+('5382075363462279', 1415272904986, 1),
+('5650512812480934', 1415271249954, 1),
+('5735648814288922', 1415036889526, 1),
+('62029084106069252', 1415241839377, 1),
+('6712150141518271', 1415285510994, 1),
+('6786243849285602', 1415811389915, 1),
+('6992436366972266', 1415242705239, 1),
+('7106071695334106', 1415811170493, 1),
+('7158700078303143', 1415284726466, 1),
+('7307203380313108', 1415819825863, 1),
+('75372031101482498', 1415284519581, 1),
+('7703030541673651', 1415272914342, 1),
+('8065501483698608', 1415819808393, 1),
+('8468895456378674', 1415241733824, 1),
+('8760904545449404', 1415285230458, 1),
+('8838732364680254', 1415271877269, 1),
+('9576830372163956', 1415283251776, 1);
+
+-- --------------------------------------------------------
+
+--
+-- Struttura della tabella `confmail`
+--
+
+CREATE TABLE IF NOT EXISTS `confmail` (
+  `user` varchar(50) COLLATE utf8_bin NOT NULL,
+  `pass` varchar(50) COLLATE utf8_bin NOT NULL,
+  `hash` varchar(50) COLLATE utf8_bin NOT NULL,
+  `time` double DEFAULT NULL,
+  UNIQUE KEY `user` (`user`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+
+-- --------------------------------------------------------
+
+--
+-- Struttura della tabella `connessi`
+--
+
+CREATE TABLE IF NOT EXISTS `connessi` (
+  `user` varchar(50) COLLATE utf8_bin NOT NULL,
+  `tempkey` varchar(50) COLLATE utf8_bin NOT NULL,
+  `thread` tinyint(1) NOT NULL,
+  `time` double NOT NULL,
+  UNIQUE KEY `tempkey` (`tempkey`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+
+--
+-- Dump dei dati per la tabella `connessi`
+--
+
+INSERT INTO `connessi` (`user`, `tempkey`, `thread`, `time`) VALUES
+('danilo.berardinelli@studio.unibo.it', '2545550210880139', 0, 1415975986391);
+
+-- --------------------------------------------------------
+
+--
+-- Struttura della tabella `esercizi`
+--
+
+CREATE TABLE IF NOT EXISTS `esercizi` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `esercizio` varchar(20) COLLATE utf8_bin NOT NULL,
+  `utente` varchar(50) COLLATE utf8_bin NOT NULL,
+  `click` int(11) NOT NULL,
+  `time` double NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `id` (`id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=4 ;
+
+--
+-- Dump dei dati per la tabella `esercizi`
+--
+
+INSERT INTO `esercizi` (`id`, `esercizio`, `utente`, `click`, `time`) VALUES
+(1, 'tautologia.xml', 'danilo.berardinelli@studio.unibo.it', 1, 1415923860705),
+(2, 'tautologia.xml', 'danilo.berardinelli@studio.unibo.it', 1, 1415975624027),
+(3, 'tautologia.xml', 'danilo.berardinelli@studio.unibo.it', 3, 1415975983857);
+
+-- --------------------------------------------------------
+
+--
+-- Struttura della tabella `utenti`
+--
+
+CREATE TABLE IF NOT EXISTS `utenti` (
+  `user` varchar(50) COLLATE utf8_bin NOT NULL,
+  `pass` varchar(15) COLLATE utf8_bin NOT NULL,
+  UNIQUE KEY `user` (`user`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+
+--
+-- Dump dei dati per la tabella `utenti`
+--
+
+INSERT INTO `utenti` (`user`, `pass`) VALUES
+('danilo.berardinelli@studio.unibo.it', '123stella');
+
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
diff --git a/Server/server/tesi/.idea/compiler.xml b/Server/server/tesi/.idea/compiler.xml
new file mode 100644 (file)
index 0000000..9a8b7e5
--- /dev/null
@@ -0,0 +1,22 @@
+<?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
diff --git a/Server/server/tesi/.idea/copyright/profiles_settings.xml b/Server/server/tesi/.idea/copyright/profiles_settings.xml
new file mode 100644 (file)
index 0000000..e7bedf3
--- /dev/null
@@ -0,0 +1,3 @@
+<component name="CopyrightManager">
+  <settings default="" />
+</component>
\ No newline at end of file
diff --git a/Server/server/tesi/.idea/description.html b/Server/server/tesi/.idea/description.html
new file mode 100644 (file)
index 0000000..db5f129
--- /dev/null
@@ -0,0 +1 @@
+<html>Simple <b>Java</b> application that includes a class with <code>main()</code> method</html>
\ No newline at end of file
diff --git a/Server/server/tesi/.idea/encodings.xml b/Server/server/tesi/.idea/encodings.xml
new file mode 100644 (file)
index 0000000..d821048
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
+</project>
\ No newline at end of file
diff --git a/Server/server/tesi/.idea/misc.xml b/Server/server/tesi/.idea/misc.xml
new file mode 100644 (file)
index 0000000..728f444
--- /dev/null
@@ -0,0 +1,12 @@
+<?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
diff --git a/Server/server/tesi/.idea/modules.xml b/Server/server/tesi/.idea/modules.xml
new file mode 100644 (file)
index 0000000..d9c1a63
--- /dev/null
@@ -0,0 +1,8 @@
+<?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
diff --git a/Server/server/tesi/.idea/project-template.xml b/Server/server/tesi/.idea/project-template.xml
new file mode 100644 (file)
index 0000000..1f08b88
--- /dev/null
@@ -0,0 +1,3 @@
+<template>
+  <input-field default="com.company">IJ_BASE_PACKAGE</input-field>
+</template>
\ No newline at end of file
diff --git a/Server/server/tesi/.idea/scopes/scope_settings.xml b/Server/server/tesi/.idea/scopes/scope_settings.xml
new file mode 100644 (file)
index 0000000..922003b
--- /dev/null
@@ -0,0 +1,5 @@
+<component name="DependencyValidationManager">
+  <state>
+    <option name="SKIP_IMPORT_STATEMENTS" value="false" />
+  </state>
+</component>
\ No newline at end of file
diff --git a/Server/server/tesi/.idea/uiDesigner.xml b/Server/server/tesi/.idea/uiDesigner.xml
new file mode 100644 (file)
index 0000000..e96534f
--- /dev/null
@@ -0,0 +1,124 @@
+<?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
diff --git a/Server/server/tesi/.idea/vcs.xml b/Server/server/tesi/.idea/vcs.xml
new file mode 100644 (file)
index 0000000..6564d52
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="" vcs="" />
+  </component>
+</project>
\ No newline at end of file
diff --git a/Server/server/tesi/.idea/workspace.xml b/Server/server/tesi/.idea/workspace.xml
new file mode 100644 (file)
index 0000000..7ff99c0
--- /dev/null
@@ -0,0 +1,1003 @@
+<?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&#9;" 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
diff --git a/Server/server/tesi/out/production/tesi/com/company/DirectoryWatcher.class b/Server/server/tesi/out/production/tesi/com/company/DirectoryWatcher.class
new file mode 100644 (file)
index 0000000..cfca534
Binary files /dev/null and b/Server/server/tesi/out/production/tesi/com/company/DirectoryWatcher.class differ
diff --git a/Server/server/tesi/out/production/tesi/com/company/EmailSender.class b/Server/server/tesi/out/production/tesi/com/company/EmailSender.class
new file mode 100644 (file)
index 0000000..f7d68c0
Binary files /dev/null and b/Server/server/tesi/out/production/tesi/com/company/EmailSender.class differ
diff --git a/Server/server/tesi/out/production/tesi/com/company/EsNameParser.class b/Server/server/tesi/out/production/tesi/com/company/EsNameParser.class
new file mode 100644 (file)
index 0000000..6b5cef6
Binary files /dev/null and b/Server/server/tesi/out/production/tesi/com/company/EsNameParser.class differ
diff --git a/Server/server/tesi/out/production/tesi/com/company/MD5.class b/Server/server/tesi/out/production/tesi/com/company/MD5.class
new file mode 100644 (file)
index 0000000..e5246c0
Binary files /dev/null and b/Server/server/tesi/out/production/tesi/com/company/MD5.class differ
diff --git a/Server/server/tesi/out/production/tesi/com/company/dbConnect.class b/Server/server/tesi/out/production/tesi/com/company/dbConnect.class
new file mode 100644 (file)
index 0000000..982753e
Binary files /dev/null and b/Server/server/tesi/out/production/tesi/com/company/dbConnect.class differ
diff --git a/Server/server/tesi/out/production/tesi/com/company/esercizi.xml b/Server/server/tesi/out/production/tesi/com/company/esercizi.xml
new file mode 100644 (file)
index 0000000..50ba729
--- /dev/null
@@ -0,0 +1,5 @@
+<?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
diff --git a/Server/server/tesi/out/production/tesi/com/company/global.class b/Server/server/tesi/out/production/tesi/com/company/global.class
new file mode 100644 (file)
index 0000000..dc41980
Binary files /dev/null and b/Server/server/tesi/out/production/tesi/com/company/global.class differ
diff --git a/Server/server/tesi/out/production/tesi/com/company/guestServer.class b/Server/server/tesi/out/production/tesi/com/company/guestServer.class
new file mode 100644 (file)
index 0000000..dbbf2f7
Binary files /dev/null and b/Server/server/tesi/out/production/tesi/com/company/guestServer.class differ
diff --git a/Server/server/tesi/out/production/tesi/com/company/httpget$MyHandler.class b/Server/server/tesi/out/production/tesi/com/company/httpget$MyHandler.class
new file mode 100644 (file)
index 0000000..0db2b2c
Binary files /dev/null and b/Server/server/tesi/out/production/tesi/com/company/httpget$MyHandler.class differ
diff --git a/Server/server/tesi/out/production/tesi/com/company/httpget.class b/Server/server/tesi/out/production/tesi/com/company/httpget.class
new file mode 100644 (file)
index 0000000..9593347
Binary files /dev/null and b/Server/server/tesi/out/production/tesi/com/company/httpget.class differ
diff --git a/Server/server/tesi/out/production/tesi/com/company/keystore.bks b/Server/server/tesi/out/production/tesi/com/company/keystore.bks
new file mode 100644 (file)
index 0000000..ecec326
Binary files /dev/null and b/Server/server/tesi/out/production/tesi/com/company/keystore.bks differ
diff --git a/Server/server/tesi/out/production/tesi/com/company/keystore.crt b/Server/server/tesi/out/production/tesi/com/company/keystore.crt
new file mode 100644 (file)
index 0000000..e60e9db
Binary files /dev/null and b/Server/server/tesi/out/production/tesi/com/company/keystore.crt differ
diff --git a/Server/server/tesi/out/production/tesi/com/company/keystore.jks b/Server/server/tesi/out/production/tesi/com/company/keystore.jks
new file mode 100644 (file)
index 0000000..4edd598
Binary files /dev/null and b/Server/server/tesi/out/production/tesi/com/company/keystore.jks differ
diff --git a/Server/server/tesi/out/production/tesi/com/company/personalServer.class b/Server/server/tesi/out/production/tesi/com/company/personalServer.class
new file mode 100644 (file)
index 0000000..81fabd7
Binary files /dev/null and b/Server/server/tesi/out/production/tesi/com/company/personalServer.class differ
diff --git a/Server/server/tesi/out/production/tesi/com/company/suString.class b/Server/server/tesi/out/production/tesi/com/company/suString.class
new file mode 100644 (file)
index 0000000..d504a2d
Binary files /dev/null and b/Server/server/tesi/out/production/tesi/com/company/suString.class differ
diff --git a/Server/server/tesi/out/production/tesi/com/company/superServer.class b/Server/server/tesi/out/production/tesi/com/company/superServer.class
new file mode 100644 (file)
index 0000000..74de9bc
Binary files /dev/null and b/Server/server/tesi/out/production/tesi/com/company/superServer.class differ
diff --git a/Server/server/tesi/out/production/tesi/com/company/xmlOperation.class b/Server/server/tesi/out/production/tesi/com/company/xmlOperation.class
new file mode 100644 (file)
index 0000000..143c104
Binary files /dev/null and b/Server/server/tesi/out/production/tesi/com/company/xmlOperation.class differ
diff --git a/Server/server/tesi/out/production/testi/com/company/DeleteFileExample.class b/Server/server/tesi/out/production/testi/com/company/DeleteFileExample.class
new file mode 100644 (file)
index 0000000..0e024f6
Binary files /dev/null and b/Server/server/tesi/out/production/testi/com/company/DeleteFileExample.class differ
diff --git a/Server/server/tesi/out/production/testi/com/company/EmailSender.class b/Server/server/tesi/out/production/testi/com/company/EmailSender.class
new file mode 100644 (file)
index 0000000..e4c00d6
Binary files /dev/null and b/Server/server/tesi/out/production/testi/com/company/EmailSender.class differ
diff --git a/Server/server/tesi/out/production/testi/com/company/EsNameParser.class b/Server/server/tesi/out/production/testi/com/company/EsNameParser.class
new file mode 100644 (file)
index 0000000..bc79739
Binary files /dev/null and b/Server/server/tesi/out/production/testi/com/company/EsNameParser.class differ
diff --git a/Server/server/tesi/out/production/testi/com/company/dbConnect.class b/Server/server/tesi/out/production/testi/com/company/dbConnect.class
new file mode 100644 (file)
index 0000000..c6a1217
Binary files /dev/null and b/Server/server/tesi/out/production/testi/com/company/dbConnect.class differ
diff --git a/Server/server/tesi/out/production/testi/com/company/esercizi.xml b/Server/server/tesi/out/production/testi/com/company/esercizi.xml
new file mode 100644 (file)
index 0000000..2d06edb
--- /dev/null
@@ -0,0 +1,3 @@
+<esercizi>
+    <esercizio>albero.xml</esercizio>
+</esercizi>
\ No newline at end of file
diff --git a/Server/server/tesi/out/production/testi/com/company/guestServer.class b/Server/server/tesi/out/production/testi/com/company/guestServer.class
new file mode 100644 (file)
index 0000000..cc9ff21
Binary files /dev/null and b/Server/server/tesi/out/production/testi/com/company/guestServer.class differ
diff --git a/Server/server/tesi/out/production/testi/com/company/httpget$MyHandler.class b/Server/server/tesi/out/production/testi/com/company/httpget$MyHandler.class
new file mode 100644 (file)
index 0000000..2426f4a
Binary files /dev/null and b/Server/server/tesi/out/production/testi/com/company/httpget$MyHandler.class differ
diff --git a/Server/server/tesi/out/production/testi/com/company/httpget.class b/Server/server/tesi/out/production/testi/com/company/httpget.class
new file mode 100644 (file)
index 0000000..740b705
Binary files /dev/null and b/Server/server/tesi/out/production/testi/com/company/httpget.class differ
diff --git a/Server/server/tesi/out/production/testi/com/company/keystore.bks b/Server/server/tesi/out/production/testi/com/company/keystore.bks
new file mode 100644 (file)
index 0000000..ecec326
Binary files /dev/null and b/Server/server/tesi/out/production/testi/com/company/keystore.bks differ
diff --git a/Server/server/tesi/out/production/testi/com/company/keystore.crt b/Server/server/tesi/out/production/testi/com/company/keystore.crt
new file mode 100644 (file)
index 0000000..e60e9db
Binary files /dev/null and b/Server/server/tesi/out/production/testi/com/company/keystore.crt differ
diff --git a/Server/server/tesi/out/production/testi/com/company/keystore.jks b/Server/server/tesi/out/production/testi/com/company/keystore.jks
new file mode 100644 (file)
index 0000000..4edd598
Binary files /dev/null and b/Server/server/tesi/out/production/testi/com/company/keystore.jks differ
diff --git a/Server/server/tesi/out/production/testi/com/company/personalServer.class b/Server/server/tesi/out/production/testi/com/company/personalServer.class
new file mode 100644 (file)
index 0000000..03678d6
Binary files /dev/null and b/Server/server/tesi/out/production/testi/com/company/personalServer.class differ
diff --git a/Server/server/tesi/out/production/testi/com/company/suString.class b/Server/server/tesi/out/production/testi/com/company/suString.class
new file mode 100644 (file)
index 0000000..d8301c9
Binary files /dev/null and b/Server/server/tesi/out/production/testi/com/company/suString.class differ
diff --git a/Server/server/tesi/out/production/testi/com/company/superServer.class b/Server/server/tesi/out/production/testi/com/company/superServer.class
new file mode 100644 (file)
index 0000000..44b721f
Binary files /dev/null and b/Server/server/tesi/out/production/testi/com/company/superServer.class differ
diff --git a/Server/server/tesi/src/com/company/DeleteFileExample.class b/Server/server/tesi/src/com/company/DeleteFileExample.class
new file mode 100644 (file)
index 0000000..25a7db8
Binary files /dev/null and b/Server/server/tesi/src/com/company/DeleteFileExample.class differ
diff --git a/Server/server/tesi/src/com/company/DirectoryWatcher.class b/Server/server/tesi/src/com/company/DirectoryWatcher.class
new file mode 100644 (file)
index 0000000..fb7ef98
Binary files /dev/null and b/Server/server/tesi/src/com/company/DirectoryWatcher.class differ
diff --git a/Server/server/tesi/src/com/company/DirectoryWhatcer.java b/Server/server/tesi/src/com/company/DirectoryWhatcer.java
new file mode 100644 (file)
index 0000000..8b376a1
--- /dev/null
@@ -0,0 +1,147 @@
+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;
+        }
+    }
+
+}
diff --git a/Server/server/tesi/src/com/company/EmailSender.class b/Server/server/tesi/src/com/company/EmailSender.class
new file mode 100644 (file)
index 0000000..8c301a8
Binary files /dev/null and b/Server/server/tesi/src/com/company/EmailSender.class differ
diff --git a/Server/server/tesi/src/com/company/EmailSender.java b/Server/server/tesi/src/com/company/EmailSender.java
new file mode 100644 (file)
index 0000000..1abf701
--- /dev/null
@@ -0,0 +1,110 @@
+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();
+    }
+    
+  }
+}
diff --git a/Server/server/tesi/src/com/company/EsNameParser.class b/Server/server/tesi/src/com/company/EsNameParser.class
new file mode 100644 (file)
index 0000000..d2cfbe3
Binary files /dev/null and b/Server/server/tesi/src/com/company/EsNameParser.class differ
diff --git a/Server/server/tesi/src/com/company/EsNameParser.java b/Server/server/tesi/src/com/company/EsNameParser.java
new file mode 100644 (file)
index 0000000..f4f1105
--- /dev/null
@@ -0,0 +1,144 @@
+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;
+    }
+}
diff --git a/Server/server/tesi/src/com/company/MD5.class b/Server/server/tesi/src/com/company/MD5.class
new file mode 100644 (file)
index 0000000..79abbc1
Binary files /dev/null and b/Server/server/tesi/src/com/company/MD5.class differ
diff --git a/Server/server/tesi/src/com/company/MD5.java b/Server/server/tesi/src/com/company/MD5.java
new file mode 100644 (file)
index 0000000..623f11f
--- /dev/null
@@ -0,0 +1,46 @@
+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;
+    }
+}
diff --git a/Server/server/tesi/src/com/company/Makefile b/Server/server/tesi/src/com/company/Makefile
new file mode 100644 (file)
index 0000000..2cc75ec
--- /dev/null
@@ -0,0 +1,2 @@
+all:
+       javac -cp "/tmp/ext/mysql-connector-java.jar:/tmp/ext/jdom-2.0.5.jar:/tmp/ext/mail-1.4.1.jar:." *.java
diff --git a/Server/server/tesi/src/com/company/dbConnect.class b/Server/server/tesi/src/com/company/dbConnect.class
new file mode 100644 (file)
index 0000000..03ff58b
Binary files /dev/null and b/Server/server/tesi/src/com/company/dbConnect.class differ
diff --git a/Server/server/tesi/src/com/company/dbConnect.java b/Server/server/tesi/src/com/company/dbConnect.java
new file mode 100644 (file)
index 0000000..28d851c
--- /dev/null
@@ -0,0 +1,355 @@
+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";
+    }
+}
diff --git a/Server/server/tesi/src/com/company/esercizi.xml b/Server/server/tesi/src/com/company/esercizi.xml
new file mode 100644 (file)
index 0000000..c28cd97
--- /dev/null
@@ -0,0 +1,10 @@
+<?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
diff --git a/Server/server/tesi/src/com/company/esercizi.xml~ b/Server/server/tesi/src/com/company/esercizi.xml~
new file mode 100644 (file)
index 0000000..47eb032
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<esercizi>\r
+  <esercizio>aalbero.xml</esercizio>\r
+</esercizi>\r
diff --git a/Server/server/tesi/src/com/company/global.class b/Server/server/tesi/src/com/company/global.class
new file mode 100644 (file)
index 0000000..00f0bd3
Binary files /dev/null and b/Server/server/tesi/src/com/company/global.class differ
diff --git a/Server/server/tesi/src/com/company/global.java b/Server/server/tesi/src/com/company/global.java
new file mode 100644 (file)
index 0000000..2bf06c4
--- /dev/null
@@ -0,0 +1,16 @@
+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;
+    
+}
diff --git a/Server/server/tesi/src/com/company/guestServer.class b/Server/server/tesi/src/com/company/guestServer.class
new file mode 100644 (file)
index 0000000..59b4c18
Binary files /dev/null and b/Server/server/tesi/src/com/company/guestServer.class differ
diff --git a/Server/server/tesi/src/com/company/guestServer.java b/Server/server/tesi/src/com/company/guestServer.java
new file mode 100644 (file)
index 0000000..1fb6ce9
--- /dev/null
@@ -0,0 +1,80 @@
+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();
+        }
+
+    }
+}
diff --git a/Server/server/tesi/src/com/company/httpget$MyHandler.class b/Server/server/tesi/src/com/company/httpget$MyHandler.class
new file mode 100644 (file)
index 0000000..7862be8
Binary files /dev/null and b/Server/server/tesi/src/com/company/httpget$MyHandler.class differ
diff --git a/Server/server/tesi/src/com/company/httpget.class b/Server/server/tesi/src/com/company/httpget.class
new file mode 100644 (file)
index 0000000..b710c11
Binary files /dev/null and b/Server/server/tesi/src/com/company/httpget.class differ
diff --git a/Server/server/tesi/src/com/company/httpget.java b/Server/server/tesi/src/com/company/httpget.java
new file mode 100644 (file)
index 0000000..079cc01
--- /dev/null
@@ -0,0 +1,79 @@
+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();
+                       }
+               }
+    }
+
+}
diff --git a/Server/server/tesi/src/com/company/keystore.bks b/Server/server/tesi/src/com/company/keystore.bks
new file mode 100644 (file)
index 0000000..ecec326
Binary files /dev/null and b/Server/server/tesi/src/com/company/keystore.bks differ
diff --git a/Server/server/tesi/src/com/company/keystore.crt b/Server/server/tesi/src/com/company/keystore.crt
new file mode 100644 (file)
index 0000000..e60e9db
Binary files /dev/null and b/Server/server/tesi/src/com/company/keystore.crt differ
diff --git a/Server/server/tesi/src/com/company/keystore.jks b/Server/server/tesi/src/com/company/keystore.jks
new file mode 100644 (file)
index 0000000..4edd598
Binary files /dev/null and b/Server/server/tesi/src/com/company/keystore.jks differ
diff --git a/Server/server/tesi/src/com/company/personalServer.class b/Server/server/tesi/src/com/company/personalServer.class
new file mode 100644 (file)
index 0000000..1d5b025
Binary files /dev/null and b/Server/server/tesi/src/com/company/personalServer.class differ
diff --git a/Server/server/tesi/src/com/company/personalServer.java b/Server/server/tesi/src/com/company/personalServer.java
new file mode 100644 (file)
index 0000000..1d338eb
--- /dev/null
@@ -0,0 +1,56 @@
+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!");
+                       }
+               }
+       }
+}
diff --git a/Server/server/tesi/src/com/company/suString.class b/Server/server/tesi/src/com/company/suString.class
new file mode 100644 (file)
index 0000000..6d094cb
Binary files /dev/null and b/Server/server/tesi/src/com/company/suString.class differ
diff --git a/Server/server/tesi/src/com/company/suString.java b/Server/server/tesi/src/com/company/suString.java
new file mode 100644 (file)
index 0000000..666febe
--- /dev/null
@@ -0,0 +1,96 @@
+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;
+       }
+}
diff --git a/Server/server/tesi/src/com/company/superServer.class b/Server/server/tesi/src/com/company/superServer.class
new file mode 100644 (file)
index 0000000..8ae6356
Binary files /dev/null and b/Server/server/tesi/src/com/company/superServer.class differ
diff --git a/Server/server/tesi/src/com/company/superServer.java b/Server/server/tesi/src/com/company/superServer.java
new file mode 100644 (file)
index 0000000..d755d9c
--- /dev/null
@@ -0,0 +1,59 @@
+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();
+                       }
+               }
+       }
+}
diff --git a/Server/server/tesi/src/com/company/testEsname.class b/Server/server/tesi/src/com/company/testEsname.class
new file mode 100644 (file)
index 0000000..4afb4d5
Binary files /dev/null and b/Server/server/tesi/src/com/company/testEsname.class differ
diff --git a/Server/server/tesi/src/com/company/xmlOperation.class b/Server/server/tesi/src/com/company/xmlOperation.class
new file mode 100644 (file)
index 0000000..f35f93f
Binary files /dev/null and b/Server/server/tesi/src/com/company/xmlOperation.class differ
diff --git a/Server/server/tesi/src/com/company/xmlOperation.java b/Server/server/tesi/src/com/company/xmlOperation.java
new file mode 100644 (file)
index 0000000..c4eff71
--- /dev/null
@@ -0,0 +1,136 @@
+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();
+        }
+    }
+
+
+}
diff --git a/Server/server/tesi/src/go.sh b/Server/server/tesi/src/go.sh
new file mode 100755 (executable)
index 0000000..4baa8fb
--- /dev/null
@@ -0,0 +1,3 @@
+#!/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
diff --git a/Server/server/tesi/tesi.iml b/Server/server/tesi/tesi.iml
new file mode 100644 (file)
index 0000000..37cc804
--- /dev/null
@@ -0,0 +1,11 @@
+<?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
diff --git a/Server/webApp/.prova.php.swp b/Server/webApp/.prova.php.swp
new file mode 100644 (file)
index 0000000..48d1c1c
Binary files /dev/null and b/Server/webApp/.prova.php.swp differ
diff --git a/Server/webApp/esercizi/aalbero.xml b/Server/webApp/esercizi/aalbero.xml
new file mode 100644 (file)
index 0000000..8591816
--- /dev/null
@@ -0,0 +1,16 @@
+<esercizio>
+    <ipotesi>
+    </ipotesi>
+    <tesi>
+        <formula type="or">
+            <formula type="and">
+                <formula type="literal">a</formula>
+                <formula type="literal">b</formula>
+            </formula>
+            <formula type="and">
+                <formula type="literal">c</formula>
+                <formula type="literal">d</formula>
+            </formula>
+        </formula>
+    </tesi>
+</esercizio>
diff --git a/Server/webApp/esercizi/demorgan.xml b/Server/webApp/esercizi/demorgan.xml
new file mode 100644 (file)
index 0000000..1445f1f
--- /dev/null
@@ -0,0 +1,27 @@
+<esercizio>
+       <ipotesi>
+       </ipotesi>
+       <tesi>
+               <formula type="impl">
+                       <formula type="or">
+                               <formula type="literal">A</formula>
+                               <formula type="literal">B</formula>
+                        </formula>
+                       <formula type="not">
+                               <formula type="and">
+                                       <formula type="not">
+                                               <formula type="literal">A</formula>
+                                       </formula>
+                                       <formula type="not">
+                                               <formula type="literal">B</formula>
+                                       </formula>
+                               </formula>
+                        </formula>
+               </formula>
+       </tesi>
+       <valutazione>
+               <click>13</click>
+               <tempo>60</tempo>
+               <altezza>5</altezza>
+       </valutazione>
+</esercizio>
diff --git a/Server/webApp/esercizi/demorgan2.xml b/Server/webApp/esercizi/demorgan2.xml
new file mode 100644 (file)
index 0000000..1445f1f
--- /dev/null
@@ -0,0 +1,27 @@
+<esercizio>
+       <ipotesi>
+       </ipotesi>
+       <tesi>
+               <formula type="impl">
+                       <formula type="or">
+                               <formula type="literal">A</formula>
+                               <formula type="literal">B</formula>
+                        </formula>
+                       <formula type="not">
+                               <formula type="and">
+                                       <formula type="not">
+                                               <formula type="literal">A</formula>
+                                       </formula>
+                                       <formula type="not">
+                                               <formula type="literal">B</formula>
+                                       </formula>
+                               </formula>
+                        </formula>
+               </formula>
+       </tesi>
+       <valutazione>
+               <click>13</click>
+               <tempo>60</tempo>
+               <altezza>5</altezza>
+       </valutazione>
+</esercizio>
diff --git a/Server/webApp/esercizi/risolvibile.xml b/Server/webApp/esercizi/risolvibile.xml
new file mode 100644 (file)
index 0000000..ee115e9
--- /dev/null
@@ -0,0 +1,35 @@
+<esercizio>
+       <ipotesi>
+               <formula type="impl">
+                       <formula type="and">
+                               <formula type="literal">A</formula>
+                               <formula type="not">
+                                       <formula type="literal">B</formula>
+                               </formula>                      
+                       </formula>
+                       <formula type="literal">R</formula>
+               </formula>
+               <formula type="impl">
+                       <formula type="or">
+                               <formula type="literal">A</formula>
+                               <formula type="literal">B</formula>                     
+                       </formula>
+                       <formula type="not">            
+                               <formula type="literal">R</formula>
+                       </formula>
+               </formula>
+               <formula type="not">
+                       <formula type="not">    
+                               <formula type="literal">A</formula>
+                       </formula>
+               </formula>
+       </ipotesi>
+       <tesi>
+               <formula type="literal">B</formula>
+       </tesi>
+       <valutazione>
+               <click>13</click>
+               <tempo>60</tempo>
+               <altezza>5</altezza>
+       </valutazione>
+</esercizio>
diff --git a/Server/webApp/esercizi/tautologia.xml b/Server/webApp/esercizi/tautologia.xml
new file mode 100644 (file)
index 0000000..4c8d1c3
--- /dev/null
@@ -0,0 +1,15 @@
+<esercizio>
+       <ipotesi>
+       </ipotesi>
+       <tesi>
+               <formula type="impl">
+                       <formula type="literal">A</formula>
+                       <formula type="literal">A</formula>
+               </formula>
+       </tesi>
+       <valutazione>
+               <click>13</click>
+               <tempo>60</tempo>
+               <altezza>5</altezza>
+       </valutazione>
+</esercizio>
diff --git a/Server/webApp/esercizi/test.xml b/Server/webApp/esercizi/test.xml
new file mode 100644 (file)
index 0000000..4a1e680
--- /dev/null
@@ -0,0 +1,12 @@
+<esercizio>
+       <ipotesi>
+       </ipotesi>
+       <tesi>
+               <formula type="atomic">top</formula>
+       </tesi>
+       <valutazione>
+               <click></click>
+               <tempo></tempo>
+               <altezza></altezza>
+       </valutazione>
+</esercizio>
diff --git a/Server/webApp/index.html b/Server/webApp/index.html
new file mode 100755 (executable)
index 0000000..62e3446
--- /dev/null
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta charset="utf-8"/>
+        <link rel="stylesheet" type="text/css" media="all" href="login.css"/>
+        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
+        <script type="text/javascript" src="./login.js"></script>
+    </head>
+    <body>
+        <h1>Benvenuto nella pagina di amministazione</h1>
+        <form id="login">
+            <input type="text" id="username" class="form-control" placeholder="Username">
+            <input type="password" id="password" class="form-control" placeholder="Password">
+            <button type="button" id="loginForm" class="btn btn-success">accedi</button>
+        </form>
+    </body>
+</html>
diff --git a/Server/webApp/index.html~ b/Server/webApp/index.html~
new file mode 100755 (executable)
index 0000000..e566e53
--- /dev/null
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta charset="utf-8"/>
+        <link rel="stylesheet" type="text/css" media="all" href="./login.css"/>
+        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
+        <script type="text/javascript" src="login.js"></script>
+    </head>
+    <body>
+        <h1>Benvenuto nella pagina di amministazione</h1>
+        <form id="login">
+            <input type="text" id="username" class="form-control" placeholder="Username">
+            <input type="password" id="password" class="form-control" placeholder="Password">
+            <button type="button" id="loginForm" class="btn btn-success">accedi</button>
+        </form>
+    </body>
+</html>
\ No newline at end of file
diff --git a/Server/webApp/login.css b/Server/webApp/login.css
new file mode 100755 (executable)
index 0000000..dc4f5da
--- /dev/null
@@ -0,0 +1,16 @@
+#login
+{
+       width:100%;
+       display:inline-block;
+       text-align:center;
+}
+#esTable
+{
+       display:block;
+       float:left;
+}
+#tabella
+{
+       display:block;
+       float:left;
+}
diff --git a/Server/webApp/login.js b/Server/webApp/login.js
new file mode 100755 (executable)
index 0000000..e9afdc4
--- /dev/null
@@ -0,0 +1,65 @@
+function change()
+{
+/*Quando viene chiamata, modifica il campo "location" di document*/
+/*effettuando un redirect sulla pagina main.php*/
+document.location.href="./main.php";
+}
+
+
+
+
+function login()
+{
+       var jsonlogin=new Object();
+       jsonlogin.username=$('#username').val(); //recupero i dati di login dai rispettivi campi dell'HTML
+       jsonlogin.password=$('#password').val();
+       var sendstr = JSON.stringify(jsonlogin); //creo il JSON di invio al server
+       $.ajax
+       ({
+        type: 'POST',
+        url: 'login.php',
+        async: false,
+        contentType: 'application/json; charset=utf-8',
+        dataType: 'json',
+        data: sendstr,
+        success: function(response)
+                        { //in caso di successo della richiesta viene eseguita questa funzione
+                                       if (response['result']=="login effettuato con successo")
+                                               //cioè se il server ha ritornato che l'utente è stato trovato con successo
+                               change();
+                   else
+                               $("#errlogin").fadeIn();
+                               setTimeout(function(){$("#errlogin").fadeOut()}, 2000);
+
+                       }
+    });
+}
+
+
+
+
+
+$(document).ready 
+(
+       function () 
+       {       
+               $("#errlogin").hide(); //nasconde i div di errore del login
+               //funzione che effettua login se bottone viene cliccato
+               $("#loginForm").click
+               (
+                       function()
+                       {
+                               login();
+                       }
+               );
+               //funzione che effettua login se tasto "INVIO" viene cliccato
+               $("#password").keyup(
+               function(invio)
+               {
+               if(invio.keyCode == 13) {
+               login();
+               }
+               
+       });
+       }
+);
diff --git a/Server/webApp/login.js~ b/Server/webApp/login.js~
new file mode 100755 (executable)
index 0000000..5866524
--- /dev/null
@@ -0,0 +1,66 @@
+function change()
+{
+/*Quando viene chiamata, modifica il campo "location" di document*/
+/*effettuando un redirect sulla pagina main.php*/
+document.location.href="./prova.html";
+}
+
+
+
+
+function login()
+{
+       var jsonlogin=new Object();
+       jsonlogin.username=$('#username').val(); //recupero i dati di login dai rispettivi campi dell'HTML
+       jsonlogin.password=$('#password').val();
+       window.alert($('#username').val()+$('#password').val());        
+       var sendstr = JSON.stringify(jsonlogin); //creo il JSON di invio al server
+       $.ajax
+       ({
+        type: 'POST',
+        url: 'login.php',
+        async: false,
+        contentType: 'application/json; charset=utf-8',
+        dataType: 'json',
+        data: sendstr,
+        success: function(response)
+                        { //in caso di successo della richiesta viene eseguita questa funzione
+                                       if (response['result']=="login effettuato con successo")
+                                               //cioè se il server ha ritornato che l'utente è stato trovato con successo
+                               change();
+                   else
+                               $("#errlogin").fadeIn();
+                               setTimeout(function(){$("#errlogin").fadeOut()}, 2000);
+
+                       }
+    });
+}
+
+
+
+
+
+$(document).ready 
+(
+       function () 
+       {       
+               $("#errlogin").hide(); //nasconde i div di errore del login
+               //funzione che effettua login se bottone viene cliccato
+               $("#loginForm").click
+               (
+                       function()
+                       {
+                               login();
+                       }
+               );
+               //funzione che effettua login se tasto "INVIO" viene cliccato
+               $("#password").keyup(
+               function(invio)
+               {
+               if(invio.keyCode == 13) {
+               login();
+               }
+               
+       });
+       }
+);
diff --git a/Server/webApp/login.php b/Server/webApp/login.php
new file mode 100755 (executable)
index 0000000..4053a81
--- /dev/null
@@ -0,0 +1,41 @@
+<?php\r
+       session_start();                                /*Inizia una sessione*/\r
+       $data = file_get_contents('php://input'); /*file_get_contents:data una stringa, recupera i parametri di query. In questo caso viene presa la stringa inviata come dato dal JS*/\r
+       $result = json_decode($data);\r
+       $con=mysqli_connect("localhost","root","cscroot","logintesi");\r
+       if ($con==false)\r
+       {\r
+               $arr=array('result'=>"errore nella connessione al database");\r
+               $ris=json_encode($arr);\r
+               echo $ris;\r
+               die;\r
+       }\r
+       else\r
+       {\r
+               $str="SELECT * FROM admin WHERE username='".$result->username."' AND password='".$result->password."';";\r
+               $exists= mysqli_query($con,$str);\r
+               if (!($exists))\r
+               {\r
+                       $arr=array('result'=>"errore nella ricerca all'interno del database");\r
+                       $ris=json_encode($arr);\r
+                       echo $ris;\r
+                       die;\r
+               }\r
+               $res=mysqli_num_rows($exists);\r
+               if ($res==1)\r
+               {\r
+                       $ID=mysqli_fetch_array($exists);\r
+                       $_SESSION["username"]=$result->username;\r
+                       $arr = array('result'=>"login effettuato con successo");\r
+                       $ris=json_encode($arr);\r
+                       echo $ris;\r
+               }\r
+               else\r
+               {\r
+                       $arr= array('result'=>"Utente non trovato");\r
+                       $ris=json_encode($arr);\r
+                       echo $ris;\r
+               }               \r
+       }\r
+       mysqli_close($con)\r
+?>\r
diff --git a/Server/webApp/login.php~ b/Server/webApp/login.php~
new file mode 100755 (executable)
index 0000000..5206e97
--- /dev/null
@@ -0,0 +1,42 @@
+<?php\r
+       session_start();                                /*Inizia una sessione*/\r
+       $data = file_get_contents('php://input'); /*file_get_contents:data una stringa, recupera i parametri di query. In questo caso viene presa la stringa inviata come dato dal JS*/\r
+       $result = json_decode($data);\r
+       $con=mysqli_connect("localhost","root","123stella","logintesi");\r
+       if ($con==false)\r
+       {\r
+               $arr=array('result'=>"errore nella connessione al database");\r
+               $ris=json_encode($arr);\r
+               echo $ris;\r
+               die;\r
+       }\r
+       else\r
+       {\r
+       $str="SELECT * FROM admin WHERE username='danilo.berardinelli' AND password='123stella';";\r
+       $exists= mysqli_query($con,$str);\r
+       if (!($exists))\r
+       {\r
+               $arr=array('result'=>"errore nella ricerca all'interno del database");\r
+               $ris=json_encode($arr);\r
+               echo $ris;\r
+               die;\r
+       }\r
+       $res=mysqli_num_rows($exists);\r
+       if ($res==1)\r
+       {\r
+               $ID=mysqli_fetch_array($exists);\r
+               $_SESSION["username"]=$result->username;\r
+               $arr = array('result'=>"login effettuato con successo");\r
+               $ris=json_encode($arr);\r
+               echo $ris;\r
+       }\r
+       else\r
+       {\r
+               $arr= array('result'=>"Utente non trovato");\r
+               $ris=json_encode($arr);\r
+               echo $ris;\r
+       }\r
+       \r
+       }\r
+       mysqli_close($con)\r
+?>\r
diff --git a/Server/webApp/logout.js b/Server/webApp/logout.js
new file mode 100755 (executable)
index 0000000..9817f6a
--- /dev/null
@@ -0,0 +1,18 @@
+function change()
+{
+       document.location.href="index.html";
+}
+function logout()
+{
+        $.ajax({
+                                       type: 'POST',
+                                       url: 'logout.php',
+                                       async: false
+                }).success
+                        (
+                                                       function(response)
+                                                       {
+                                                               change();
+                                                       }
+                        );
+}
diff --git a/Server/webApp/logout.php b/Server/webApp/logout.php
new file mode 100755 (executable)
index 0000000..7060d00
--- /dev/null
@@ -0,0 +1,7 @@
+<?php
+       session_start();
+       unset($_SESSION['ID']);
+       $arr=array('result'=>"logout effettuato con successo");
+       $ris=json_encode($arr);
+       echo $ris;
+?>
diff --git a/Server/webApp/main.php b/Server/webApp/main.php
new file mode 100755 (executable)
index 0000000..2866325
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+        session_start();
+//se non c'è la sessione registrata
+
+        if (!isset($_SESSION['username']))
+        {
+                header("location: index.html");
+        }
+?>
+
+
+<!DOCTYPE html>
+<html>
+       <head>
+               <meta charset="utf-8"/>
+        <link rel="stylesheet" type="text/css" media="all" href="login.css"/>
+               <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
+               <script type="text/javascript" src="./prova.js"></script>
+       </head>
+       <body>
+               <form action="upload.php" method="post" enctype="multipart/form-data">
+                       Select file to upload:
+                       <input type="file" name="fileToUpload" id="fileToUpload">
+                       <input type="submit" value="Upload" name="submit">
+               </form>
+               <br/>
+               <div>
+                       <table id="esTable">
+                               <tr>
+                                       <th>Lista Esercizi</th>
+                               </tr>
+                       </table>
+                       <table id="tabella">
+                               <tr id="intestazione">
+                                       <th>Nome Esercizio</th>
+                                       <th>Studente</th>
+                               <th>click</th>
+                       </tr>
+               </div>
+       </body>
+</html>
diff --git a/Server/webApp/printEs.php b/Server/webApp/printEs.php
new file mode 100755 (executable)
index 0000000..6c4b6e8
--- /dev/null
@@ -0,0 +1,13 @@
+<?php
+       if ($handle = opendir('/var/www/html/esercizi')) 
+       {
+               echo "File:<br/>";
+
+          while (false !== ($file = readdir($handle))) { 
+                  if($file!="." && $file!="..")
+                       echo "$file<br/>";
+          }
+
+          closedir($handle); 
+       }
+?>
diff --git a/Server/webApp/prova.html~ b/Server/webApp/prova.html~
new file mode 100755 (executable)
index 0000000..0e3d827
--- /dev/null
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+    <head>
+    </head>
+    <body>
+        <form action="upload.php" method="post" enctype="multipart/form-data">
+               <input type="file" name="upfile">
+               <input type="hidden" name="MAX_FILE_SIZE" value="10000">
+               <input type="submit" value="Invia il file">
+       </form>
+    </body>
+</html>
diff --git a/Server/webApp/prova.js b/Server/webApp/prova.js
new file mode 100755 (executable)
index 0000000..62d03ef
--- /dev/null
@@ -0,0 +1,72 @@
+function update(event)
+{
+       var str;
+       if (event==null)
+               str='all';
+    else{
+               var object=event.target;
+               str=object.getAttribute("esercizio");
+       }
+       var query="./serverRequest.php";
+       var request=new Object();
+       request.name=str;
+       var sendstr=JSON.stringify(request);
+       $.ajax({
+               url:query,
+               type:"POST",
+               async: "true",
+               dataType: "json",
+               data:sendstr,
+               contentType: "application/json; charset=utf-8",
+               success:function(val)
+               {
+                       $("#tabella").empty();
+                       $("#tabella").append("<tr><th>Nome Esercizio</th><th>Studente</th><th>Click</th>");
+                       $.each(val.esercizi, function(i, item) {
+                               var id="es"+i;
+                               for(j=0;j<item.risultati.length;j++)
+                               {
+                                       var id_i=id+j;
+                                       $("#tabella").append($('<tr>').attr('id',id_i));
+                                       id_i="#"+id_i;
+                                       $(id_i).append($('<td>').text(item.esercizio));
+                                       $(id_i).append($('<td>').text(item.risultati[j].utente));
+                                       $(id_i).append($('<td>').text(item.risultati[j].click));
+                                       $(id_i).append($('<input class="eliminaRis" type="submit" value="elimina">').attr('risultato',item.risultati[j].click));
+                               }
+                       });
+               },
+       });
+}
+
+function esList()
+{
+       var query="./xmlPharse.php";
+       $.ajax({
+               url:query,
+               type:"GET",
+               async: "true",
+               dataType: "json",
+               accepts: {json:"application/json"},
+               success:function(val)
+               {
+                       $("#esTable").empty();
+                       $("#esTable").append("<tr><th>Nome Esercizio</th>");
+                       $.each(val.esercizi, function(i, item) {
+                               var id="ex"+i;
+                               $("#esTable").append($('<tr>').attr('id',id));
+                               $("#ex"+i).append($('<td>').text(item));
+                               $("#ex"+i).append($('<input class="seleziona" type="submit" value="seleziona">').attr('esercizio',item));
+                               $("#ex"+i).append($('<input class="elimina" type="submit" value="elimina">').attr('esercizio',item));
+                       });
+                       $("#esTable").append('<button type="button" esercizio="all" class="seleziona">seleziona tutti</button>');
+                       $(".seleziona").click(function(event){update(event);});
+               },
+       });
+}
+
+$(document).ready(function(){
+               esList();
+               update();
+               $(".seleziona").click(function(event){update(event);});
+});
diff --git a/Server/webApp/prova.pho b/Server/webApp/prova.pho
new file mode 100755 (executable)
index 0000000..e69de29
diff --git a/Server/webApp/prova.pho~ b/Server/webApp/prova.pho~
new file mode 100755 (executable)
index 0000000..e69de29
diff --git a/Server/webApp/prova.php b/Server/webApp/prova.php
new file mode 100755 (executable)
index 0000000..6284333
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+       $target_dir = "esercizi/";
+       $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
+       $uploadOk = 1;
+       $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
+       // Check if file already exists
+       if (file_exists($target_file)) {
+           echo "Sorry, file already exists.";
+           $uploadOk = 0;
+       }
+       // Check file size
+       if ($_FILES["fileToUpload"]["size"] > 500000) {
+           echo "Sorry, your file is too large.";
+           $uploadOk = 0;
+       }
+       // Check if $uploadOk is set to 0 by an error
+       if ($uploadOk == 0) {
+           echo "Sorry, your file was not uploaded.";
+       // if everything is ok, try to upload file
+       } else {
+           if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
+               echo "The file ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded.";
+           } else {
+               echo "Sorry, there was an error uploading your file.";
+           }
+       }
+       echo exec("php-cli  main.php");
+?>
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+       <form action="upload.php" method="post" enctype="multipart/form-data">
+               Select file to upload:
+               <input type="file" name="fileToUpload" id="fileToUpload">
+               <input type="submit" value="Upload" name="submit">
+       </form>
+</body>
diff --git a/Server/webApp/prova.php~ b/Server/webApp/prova.php~
new file mode 100755 (executable)
index 0000000..0f7fcaa
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+       $target_dir = "esercizi/";
+       $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
+       $uploadOk = 1;
+       $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
+       // Check if image file is a actual image or fake image
+       /*if(isset($_POST["submit"])) {
+           $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
+           if($check !== false) {
+               echo "File is an image - " . $check["mime"] . ".";
+               $uploadOk = 1;
+           } else {
+               echo "File is not an image.";
+               $uploadOk = 0;
+           }
+       }*/
+       // Check if file already exists
+       if (file_exists($target_file)) {
+           echo "Sorry, file already exists.";
+           $uploadOk = 0;
+       }
+       // Check file size
+       if ($_FILES["fileToUpload"]["size"] > 500000) {
+           echo "Sorry, your file is too large.";
+           $uploadOk = 0;
+       }
+       // Allow certain file formats
+       /*if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
+       && $imageFileType != "gif" ) {
+           echo "Sorry, only JPG, JPEG, PNG & GIF files are allowed.";
+           $uploadOk = 0;
+       }*/
+       // Check if $uploadOk is set to 0 by an error
+       if ($uploadOk == 0) {
+           echo "Sorry, your file was not uploaded.";
+       // if everything is ok, try to upload file
+       } else {
+           if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
+               echo "The file ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded.";
+           } else {
+               echo "Sorry, there was an error uploading your file.";
+           }
+       }
+?>
diff --git a/Server/webApp/prova.txt b/Server/webApp/prova.txt
new file mode 100755 (executable)
index 0000000..28c1837
--- /dev/null
@@ -0,0 +1,2 @@
+mi sei riuscito a scaricare
+
diff --git a/Server/webApp/prova.txt~ b/Server/webApp/prova.txt~
new file mode 100755 (executable)
index 0000000..e69de29
diff --git a/Server/webApp/serverRequest.php b/Server/webApp/serverRequest.php
new file mode 100755 (executable)
index 0000000..9140fd7
--- /dev/null
@@ -0,0 +1,54 @@
+<?php
+       include 'util.php';
+       $data = file_get_contents('php://input'); /*file_get_contents:data una stringa, recupera i parametri di query. In questo caso viene presa la stringa inviata come dato dal JS*/
+       $result = json_decode($data);
+       $con=mysqli_connect("localhost","root","cscroot","logintesi");
+       if ($con==false)
+       {
+               $arr=array('result'=>"errore nella connessione al database");
+               $ris=json_encode($arr);
+               echo $ris;
+               die;
+       }
+       if($result->name=='all')
+               $str="SELECT * FROM esercizi;";
+       else
+               $str="SELECT * FROM esercizi WHERE esercizio='".$result->name."' ORDER BY esercizio;";
+       $str=mysqli_query($con,$str);
+       if (!$str)
+       {
+               $arr= array('result'=>"nessun elemento presente");
+               $ris=json_encode($arr);
+               echo $ris;
+               die;
+       }
+       $esercizi;
+       $risp=mysqli_fetch_array($str);
+       $risultati;
+       $esercizio['esercizio']=$risp['esercizio'];
+       do
+       {
+               if($esercizio['esercizio']==$risp['esercizio'])
+               {
+                       //aggiungo utenti e click ell'es corrente
+                       $risultati[]=array('id'=>$risp['id'],'utente'=>$risp['utente'],'click'=>$risp['click']);
+               }
+               else
+               {
+                       //reimposto i campi per un nuovo esercizio
+                       $esercizio['risultati']=$risultati;
+                       $esercizi[]=$esercizio;
+                       unset($esercizio);
+                       unset($risultati);
+                       $esercizio['esercizio']=$risp['esercizio'];
+                       $risultati[]=array('id'=>$risp['id'],'utente'=>$risp['utente'],'click'=>$risp['click']);
+               }
+       }while($risp=mysqli_fetch_array($str));      
+       $esercizio['risultati']=$risultati;
+       $esercizi[]=$esercizio;
+       $ex=array('esercizi'=>$esercizi);
+       unset($esercizio);
+       unset($risultati);              
+       $return_json=__json_encode($ex);
+       echo $return_json;
+?>
diff --git a/Server/webApp/upload.php b/Server/webApp/upload.php
new file mode 100755 (executable)
index 0000000..67c3a7a
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+       $target_dir = "esercizi/";
+       $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
+       $uploadOk = 1;
+       $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
+       // Check if image file is a actual image or fake image
+       /*if(isset($_POST["submit"])) {
+               $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
+               if($check !== false) {
+                       echo "File is an image - " . $check["mime"] . ".";
+                       $uploadOk = 1;
+               } else {
+                       echo "File is not an image.";
+                       $uploadOk = 0;
+               }
+       }*/
+       // Check if file already exists
+       if (file_exists($target_file)) {
+               echo "Sorry, file already exists.";
+               $uploadOk = 0;
+       }
+       // Check file size
+       if ($_FILES["fileToUpload"]["size"] > 500000) {
+               echo "Sorry, your file is too large.";
+               $uploadOk = 0;
+       }
+       // Allow certain file formats
+       /*if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
+       && $imageFileType != "gif" ) {
+               echo "Sorry, only JPG, JPEG, PNG & GIF files are allowed.";
+               $uploadOk = 0;
+       }*/
+       // Check if $uploadOk is set to 0 by an error
+       if ($uploadOk == 0) {
+               echo "Sorry, your file was not uploaded.";
+       // if everything is ok, try to upload file
+       } else {
+               if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
+                       echo "The file ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded.";
+               } else {
+                       echo "Sorry, there was an error uploading your file.";
+               }
+       }
+?>
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+       <form action="main.php">
+               <input type="submit" value="indietro" name="submit">
+       </form>
+</body>
diff --git a/Server/webApp/upload.php~ b/Server/webApp/upload.php~
new file mode 100755 (executable)
index 0000000..9cf7a77
--- /dev/null
@@ -0,0 +1,33 @@
+<?
+       // QUESTE RIGHE RENDONO LO SCRIPT COMPATIBILE CON LE VERSIONI
+       // DI PHP PRECEDENTI ALLA 4.1.0
+       if(!isset($_FILES)) $_FILES = $HTTP_POST_FILES;
+       if(!isset($_SERVER)) $_SERVER = $HTTP_SERVER_VARS;
+       /********************* VARIABILI DA SETTARE ********************/
+       // Directory dove salvare i files Uploadati ( chmod 777, percorso assoluto)
+       $upload_dir = "/home/furt/brogetto/data";
+
+       // Eventuale nuovo nome da dare al file uploadato
+       $new_name = "";
+
+       // Se $new_name è vuota, il nome sarà lo stesso del file uploadato
+       $file_name = ($new_name) ? $new_name : $_FILES["upfile"]["name"];
+
+       if(trim($_FILES["upfile"]["name"]) == "") 
+       {
+               die("Non hai indicato il file da uploadare !");
+       }
+
+       if(@is_uploaded_file($_FILES["upfile"]["tmp_name"])) {
+
+       @move_uploaded_file($_FILES["upfile"]["tmp_name"], $upload_dir."/".$file_name) 
+       or die("Impossibile spostare il file, controlla l’esistenza o i permessi della directory dove fare l’upload.");
+
+       } else {
+
+       die("Problemi nell’upload del file" . $_FILES["upfile"]["name"]);
+
+       }
+
+       echo "L’upload del file" . $_FILES["upfile"]["name"] . "è avvenuto correttamente";
+?>
diff --git a/Server/webApp/util.php b/Server/webApp/util.php
new file mode 100755 (executable)
index 0000000..0c7fbec
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+function __json_encode($data) {
+        if (is_array ( $data ) || is_object ( $data )) {
+                $islist = is_array ( $data ) && (empty ( $data ) || array_keys ( $data ) === range ( 0, count ( $data ) - 1 ));
+
+                if ($islist) {
+                        $json = '[' . implode ( ',', array_map ( '__json_encode', $data ) ) . ']';
+                } else {
+                        $items = Array ();
+                        foreach ( $data as $key => $value ) {
+                                $items [] = __json_encode ( "$key" ) . ':' . __json_encode ( $value );
+                        }
+                        $json = '{' . implode ( ',', $items ) . '}';
+                }
+        } elseif (is_string ( $data )) {
+                $json = '"' . addcslashes ( $data, '\\"' ) . '"';
+        } else {
+                // int, floats, bools, null
+                $json = strtolower ( var_export ( $data, true ) );
+        }
+        return $json;
+}
+
+function GET_check()
+{
+if (!isset($_GET['scope']) or !isset($_GET['type']) or !($_GET['lat']) or !isset($_GET['lng']) or !isset($_GET['radius']) or !isset($_GET['timemin']) or !isset($_GET['timemax']) or !isset($_GET['status']))
+       return false;
+else return true;
+}
+function POST_check($params)
+{
+if (!$params->type or !$params->lat or !$params->lng) return false;
+else return true;
+}
+
+function NOTIFY_check($params)
+{
+if (!$params->event_id or !$params->lat or !$params->lng or !$params->status) return false;
+else return true;
+}
+?>
diff --git a/Server/webApp/xmlPharse.php b/Server/webApp/xmlPharse.php
new file mode 100755 (executable)
index 0000000..a2090df
--- /dev/null
@@ -0,0 +1,11 @@
+<?php
+       include 'util.php';
+       $xml = simplexml_load_file('/home/claudio/tesi_applet/Server/server/tesi/src/com/company/esercizi.xml');
+       $esercizi;
+       foreach($xml->esercizio as $esercizio)
+       {
+               $esercizi['esercizi'][]="$esercizio";
+       }
+       $return_json=__json_encode($esercizi);
+       echo $return_json;
+?>
diff --git a/public_html/esercizi/demorgan2.xml b/public_html/esercizi/demorgan2.xml
new file mode 100644 (file)
index 0000000..1445f1f
--- /dev/null
@@ -0,0 +1,27 @@
+<esercizio>
+       <ipotesi>
+       </ipotesi>
+       <tesi>
+               <formula type="impl">
+                       <formula type="or">
+                               <formula type="literal">A</formula>
+                               <formula type="literal">B</formula>
+                        </formula>
+                       <formula type="not">
+                               <formula type="and">
+                                       <formula type="not">
+                                               <formula type="literal">A</formula>
+                                       </formula>
+                                       <formula type="not">
+                                               <formula type="literal">B</formula>
+                                       </formula>
+                               </formula>
+                        </formula>
+               </formula>
+       </tesi>
+       <valutazione>
+               <click>13</click>
+               <tempo>60</tempo>
+               <altezza>5</altezza>
+       </valutazione>
+</esercizio>
diff --git a/public_html/esercizi/risolvibile.xml b/public_html/esercizi/risolvibile.xml
new file mode 100644 (file)
index 0000000..ee115e9
--- /dev/null
@@ -0,0 +1,35 @@
+<esercizio>
+       <ipotesi>
+               <formula type="impl">
+                       <formula type="and">
+                               <formula type="literal">A</formula>
+                               <formula type="not">
+                                       <formula type="literal">B</formula>
+                               </formula>                      
+                       </formula>
+                       <formula type="literal">R</formula>
+               </formula>
+               <formula type="impl">
+                       <formula type="or">
+                               <formula type="literal">A</formula>
+                               <formula type="literal">B</formula>                     
+                       </formula>
+                       <formula type="not">            
+                               <formula type="literal">R</formula>
+                       </formula>
+               </formula>
+               <formula type="not">
+                       <formula type="not">    
+                               <formula type="literal">A</formula>
+                       </formula>
+               </formula>
+       </ipotesi>
+       <tesi>
+               <formula type="literal">B</formula>
+       </tesi>
+       <valutazione>
+               <click>13</click>
+               <tempo>60</tempo>
+               <altezza>5</altezza>
+       </valutazione>
+</esercizio>
diff --git a/public_html/esercizi/test.xml b/public_html/esercizi/test.xml
new file mode 100644 (file)
index 0000000..7985a27
--- /dev/null
@@ -0,0 +1,12 @@
+<esercizio>
+       <ipotesi>
+       </ipotesi>
+       <tesi>
+               <formula type="atomic">top</formula>
+       </tesi>
+       <valutazione>
+               <click>1</click>
+               <tempo>5</tempo>
+               <altezza>1</altezza>
+       </valutazione>
+</esercizio>
diff --git a/public_html/esercizi/triviale.xml b/public_html/esercizi/triviale.xml
new file mode 100644 (file)
index 0000000..b7fb3dc
--- /dev/null
@@ -0,0 +1,15 @@
+<esercizio>
+       <ipotesi>
+       </ipotesi>
+       <tesi>
+               <formula type="impl">
+                       <formula type="literal">A</formula>
+                       <formula type="literal">A</formula>
+               </formula>
+       </tesi>
+       <valutazione>
+               <click>2</click>
+               <tempo>10</tempo>
+               <altezza>2</altezza>
+       </valutazione>
+</esercizio>
diff --git a/public_html/index.html b/public_html/index.html
new file mode 100755 (executable)
index 0000000..62e3446
--- /dev/null
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta charset="utf-8"/>
+        <link rel="stylesheet" type="text/css" media="all" href="login.css"/>
+        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
+        <script type="text/javascript" src="./login.js"></script>
+    </head>
+    <body>
+        <h1>Benvenuto nella pagina di amministazione</h1>
+        <form id="login">
+            <input type="text" id="username" class="form-control" placeholder="Username">
+            <input type="password" id="password" class="form-control" placeholder="Password">
+            <button type="button" id="loginForm" class="btn btn-success">accedi</button>
+        </form>
+    </body>
+</html>
diff --git a/public_html/index.html~ b/public_html/index.html~
new file mode 100755 (executable)
index 0000000..e566e53
--- /dev/null
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta charset="utf-8"/>
+        <link rel="stylesheet" type="text/css" media="all" href="./login.css"/>
+        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
+        <script type="text/javascript" src="login.js"></script>
+    </head>
+    <body>
+        <h1>Benvenuto nella pagina di amministazione</h1>
+        <form id="login">
+            <input type="text" id="username" class="form-control" placeholder="Username">
+            <input type="password" id="password" class="form-control" placeholder="Password">
+            <button type="button" id="loginForm" class="btn btn-success">accedi</button>
+        </form>
+    </body>
+</html>
\ No newline at end of file
diff --git a/public_html/login.css b/public_html/login.css
new file mode 100755 (executable)
index 0000000..dc4f5da
--- /dev/null
@@ -0,0 +1,16 @@
+#login
+{
+       width:100%;
+       display:inline-block;
+       text-align:center;
+}
+#esTable
+{
+       display:block;
+       float:left;
+}
+#tabella
+{
+       display:block;
+       float:left;
+}
diff --git a/public_html/login.js b/public_html/login.js
new file mode 100755 (executable)
index 0000000..e9afdc4
--- /dev/null
@@ -0,0 +1,65 @@
+function change()
+{
+/*Quando viene chiamata, modifica il campo "location" di document*/
+/*effettuando un redirect sulla pagina main.php*/
+document.location.href="./main.php";
+}
+
+
+
+
+function login()
+{
+       var jsonlogin=new Object();
+       jsonlogin.username=$('#username').val(); //recupero i dati di login dai rispettivi campi dell'HTML
+       jsonlogin.password=$('#password').val();
+       var sendstr = JSON.stringify(jsonlogin); //creo il JSON di invio al server
+       $.ajax
+       ({
+        type: 'POST',
+        url: 'login.php',
+        async: false,
+        contentType: 'application/json; charset=utf-8',
+        dataType: 'json',
+        data: sendstr,
+        success: function(response)
+                        { //in caso di successo della richiesta viene eseguita questa funzione
+                                       if (response['result']=="login effettuato con successo")
+                                               //cioè se il server ha ritornato che l'utente è stato trovato con successo
+                               change();
+                   else
+                               $("#errlogin").fadeIn();
+                               setTimeout(function(){$("#errlogin").fadeOut()}, 2000);
+
+                       }
+    });
+}
+
+
+
+
+
+$(document).ready 
+(
+       function () 
+       {       
+               $("#errlogin").hide(); //nasconde i div di errore del login
+               //funzione che effettua login se bottone viene cliccato
+               $("#loginForm").click
+               (
+                       function()
+                       {
+                               login();
+                       }
+               );
+               //funzione che effettua login se tasto "INVIO" viene cliccato
+               $("#password").keyup(
+               function(invio)
+               {
+               if(invio.keyCode == 13) {
+               login();
+               }
+               
+       });
+       }
+);
diff --git a/public_html/login.js~ b/public_html/login.js~
new file mode 100755 (executable)
index 0000000..5866524
--- /dev/null
@@ -0,0 +1,66 @@
+function change()
+{
+/*Quando viene chiamata, modifica il campo "location" di document*/
+/*effettuando un redirect sulla pagina main.php*/
+document.location.href="./prova.html";
+}
+
+
+
+
+function login()
+{
+       var jsonlogin=new Object();
+       jsonlogin.username=$('#username').val(); //recupero i dati di login dai rispettivi campi dell'HTML
+       jsonlogin.password=$('#password').val();
+       window.alert($('#username').val()+$('#password').val());        
+       var sendstr = JSON.stringify(jsonlogin); //creo il JSON di invio al server
+       $.ajax
+       ({
+        type: 'POST',
+        url: 'login.php',
+        async: false,
+        contentType: 'application/json; charset=utf-8',
+        dataType: 'json',
+        data: sendstr,
+        success: function(response)
+                        { //in caso di successo della richiesta viene eseguita questa funzione
+                                       if (response['result']=="login effettuato con successo")
+                                               //cioè se il server ha ritornato che l'utente è stato trovato con successo
+                               change();
+                   else
+                               $("#errlogin").fadeIn();
+                               setTimeout(function(){$("#errlogin").fadeOut()}, 2000);
+
+                       }
+    });
+}
+
+
+
+
+
+$(document).ready 
+(
+       function () 
+       {       
+               $("#errlogin").hide(); //nasconde i div di errore del login
+               //funzione che effettua login se bottone viene cliccato
+               $("#loginForm").click
+               (
+                       function()
+                       {
+                               login();
+                       }
+               );
+               //funzione che effettua login se tasto "INVIO" viene cliccato
+               $("#password").keyup(
+               function(invio)
+               {
+               if(invio.keyCode == 13) {
+               login();
+               }
+               
+       });
+       }
+);
diff --git a/public_html/login.php b/public_html/login.php
new file mode 100755 (executable)
index 0000000..adadff4
--- /dev/null
@@ -0,0 +1,41 @@
+<?php\r
+       session_start();                                /*Inizia una sessione*/\r
+       $data = file_get_contents('php://input'); /*file_get_contents:data una stringa, recupera i parametri di query. In questo caso viene presa la stringa inviata come dato dal JS*/\r
+       $result = json_decode($data);\r
+       $con=mysqli_connect("localhost","root","csc@CerCo!","logintesi");\r
+       if ($con==false)\r
+       {\r
+               $arr=array('result'=>"errore nella connessione al database");\r
+               $ris=json_encode($arr);\r
+               echo $ris;\r
+               die;\r
+       }\r
+       else\r
+       {\r
+               $str="SELECT * FROM admin WHERE username='".$result->username."' AND password='".$result->password."';";\r
+               $exists= mysqli_query($con,$str);\r
+               if (!($exists))\r
+               {\r
+                       $arr=array('result'=>"errore nella ricerca all'interno del database");\r
+                       $ris=json_encode($arr);\r
+                       echo $ris;\r
+                       die;\r
+               }\r
+               $res=mysqli_num_rows($exists);\r
+               if ($res==1)\r
+               {\r
+                       $ID=mysqli_fetch_array($exists);\r
+                       $_SESSION["username"]=$result->username;\r
+                       $arr = array('result'=>"login effettuato con successo");\r
+                       $ris=json_encode($arr);\r
+                       echo $ris;\r
+               }\r
+               else\r
+               {\r
+                       $arr= array('result'=>"Utente non trovato");\r
+                       $ris=json_encode($arr);\r
+                       echo $ris;\r
+               }               \r
+       }\r
+       mysqli_close($con)\r
+?>\r
diff --git a/public_html/login.php~ b/public_html/login.php~
new file mode 100755 (executable)
index 0000000..5206e97
--- /dev/null
@@ -0,0 +1,42 @@
+<?php\r
+       session_start();                                /*Inizia una sessione*/\r
+       $data = file_get_contents('php://input'); /*file_get_contents:data una stringa, recupera i parametri di query. In questo caso viene presa la stringa inviata come dato dal JS*/\r
+       $result = json_decode($data);\r
+       $con=mysqli_connect("localhost","root","123stella","logintesi");\r
+       if ($con==false)\r
+       {\r
+               $arr=array('result'=>"errore nella connessione al database");\r
+               $ris=json_encode($arr);\r
+               echo $ris;\r
+               die;\r
+       }\r
+       else\r
+       {\r
+       $str="SELECT * FROM admin WHERE username='danilo.berardinelli' AND password='123stella';";\r
+       $exists= mysqli_query($con,$str);\r
+       if (!($exists))\r
+       {\r
+               $arr=array('result'=>"errore nella ricerca all'interno del database");\r
+               $ris=json_encode($arr);\r
+               echo $ris;\r
+               die;\r
+       }\r
+       $res=mysqli_num_rows($exists);\r
+       if ($res==1)\r
+       {\r
+               $ID=mysqli_fetch_array($exists);\r
+               $_SESSION["username"]=$result->username;\r
+               $arr = array('result'=>"login effettuato con successo");\r
+               $ris=json_encode($arr);\r
+               echo $ris;\r
+       }\r
+       else\r
+       {\r
+               $arr= array('result'=>"Utente non trovato");\r
+               $ris=json_encode($arr);\r
+               echo $ris;\r
+       }\r
+       \r
+       }\r
+       mysqli_close($con)\r
+?>\r
diff --git a/public_html/logout.js b/public_html/logout.js
new file mode 100755 (executable)
index 0000000..9817f6a
--- /dev/null
@@ -0,0 +1,18 @@
+function change()
+{
+       document.location.href="index.html";
+}
+function logout()
+{
+        $.ajax({
+                                       type: 'POST',
+                                       url: 'logout.php',
+                                       async: false
+                }).success
+                        (
+                                                       function(response)
+                                                       {
+                                                               change();
+                                                       }
+                        );
+}
diff --git a/public_html/logout.php b/public_html/logout.php
new file mode 100755 (executable)
index 0000000..7060d00
--- /dev/null
@@ -0,0 +1,7 @@
+<?php
+       session_start();
+       unset($_SESSION['ID']);
+       $arr=array('result'=>"logout effettuato con successo");
+       $ris=json_encode($arr);
+       echo $ris;
+?>
diff --git a/public_html/main.php b/public_html/main.php
new file mode 100755 (executable)
index 0000000..2866325
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+        session_start();
+//se non c'è la sessione registrata
+
+        if (!isset($_SESSION['username']))
+        {
+                header("location: index.html");
+        }
+?>
+
+
+<!DOCTYPE html>
+<html>
+       <head>
+               <meta charset="utf-8"/>
+        <link rel="stylesheet" type="text/css" media="all" href="login.css"/>
+               <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
+               <script type="text/javascript" src="./prova.js"></script>
+       </head>
+       <body>
+               <form action="upload.php" method="post" enctype="multipart/form-data">
+                       Select file to upload:
+                       <input type="file" name="fileToUpload" id="fileToUpload">
+                       <input type="submit" value="Upload" name="submit">
+               </form>
+               <br/>
+               <div>
+                       <table id="esTable">
+                               <tr>
+                                       <th>Lista Esercizi</th>
+                               </tr>
+                       </table>
+                       <table id="tabella">
+                               <tr id="intestazione">
+                                       <th>Nome Esercizio</th>
+                                       <th>Studente</th>
+                               <th>click</th>
+                       </tr>
+               </div>
+       </body>
+</html>
diff --git a/public_html/printEs.php b/public_html/printEs.php
new file mode 100755 (executable)
index 0000000..6c4b6e8
--- /dev/null
@@ -0,0 +1,13 @@
+<?php
+       if ($handle = opendir('/var/www/html/esercizi')) 
+       {
+               echo "File:<br/>";
+
+          while (false !== ($file = readdir($handle))) { 
+                  if($file!="." && $file!="..")
+                       echo "$file<br/>";
+          }
+
+          closedir($handle); 
+       }
+?>
diff --git a/public_html/prova.html~ b/public_html/prova.html~
new file mode 100755 (executable)
index 0000000..0e3d827
--- /dev/null
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+    <head>
+    </head>
+    <body>
+        <form action="upload.php" method="post" enctype="multipart/form-data">
+               <input type="file" name="upfile">
+               <input type="hidden" name="MAX_FILE_SIZE" value="10000">
+               <input type="submit" value="Invia il file">
+       </form>
+    </body>
+</html>
diff --git a/public_html/prova.js b/public_html/prova.js
new file mode 100755 (executable)
index 0000000..62d03ef
--- /dev/null
@@ -0,0 +1,72 @@
+function update(event)
+{
+       var str;
+       if (event==null)
+               str='all';
+    else{
+               var object=event.target;
+               str=object.getAttribute("esercizio");
+       }
+       var query="./serverRequest.php";
+       var request=new Object();
+       request.name=str;
+       var sendstr=JSON.stringify(request);
+       $.ajax({
+               url:query,
+               type:"POST",
+               async: "true",
+               dataType: "json",
+               data:sendstr,
+               contentType: "application/json; charset=utf-8",
+               success:function(val)
+               {
+                       $("#tabella").empty();
+                       $("#tabella").append("<tr><th>Nome Esercizio</th><th>Studente</th><th>Click</th>");
+                       $.each(val.esercizi, function(i, item) {
+                               var id="es"+i;
+                               for(j=0;j<item.risultati.length;j++)
+                               {
+                                       var id_i=id+j;
+                                       $("#tabella").append($('<tr>').attr('id',id_i));
+                                       id_i="#"+id_i;
+                                       $(id_i).append($('<td>').text(item.esercizio));
+                                       $(id_i).append($('<td>').text(item.risultati[j].utente));
+                                       $(id_i).append($('<td>').text(item.risultati[j].click));
+                                       $(id_i).append($('<input class="eliminaRis" type="submit" value="elimina">').attr('risultato',item.risultati[j].click));
+                               }
+                       });
+               },
+       });
+}
+
+function esList()
+{
+       var query="./xmlPharse.php";
+       $.ajax({
+               url:query,
+               type:"GET",
+               async: "true",
+               dataType: "json",
+               accepts: {json:"application/json"},
+               success:function(val)
+               {
+                       $("#esTable").empty();
+                       $("#esTable").append("<tr><th>Nome Esercizio</th>");
+                       $.each(val.esercizi, function(i, item) {
+                               var id="ex"+i;
+                               $("#esTable").append($('<tr>').attr('id',id));
+                               $("#ex"+i).append($('<td>').text(item));
+                               $("#ex"+i).append($('<input class="seleziona" type="submit" value="seleziona">').attr('esercizio',item));
+                               $("#ex"+i).append($('<input class="elimina" type="submit" value="elimina">').attr('esercizio',item));
+                       });
+                       $("#esTable").append('<button type="button" esercizio="all" class="seleziona">seleziona tutti</button>');
+                       $(".seleziona").click(function(event){update(event);});
+               },
+       });
+}
+
+$(document).ready(function(){
+               esList();
+               update();
+               $(".seleziona").click(function(event){update(event);});
+});
diff --git a/public_html/prova.pho b/public_html/prova.pho
new file mode 100755 (executable)
index 0000000..e69de29
diff --git a/public_html/prova.pho~ b/public_html/prova.pho~
new file mode 100755 (executable)
index 0000000..e69de29
diff --git a/public_html/prova.php b/public_html/prova.php
new file mode 100755 (executable)
index 0000000..6284333
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+       $target_dir = "esercizi/";
+       $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
+       $uploadOk = 1;
+       $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
+       // Check if file already exists
+       if (file_exists($target_file)) {
+           echo "Sorry, file already exists.";
+           $uploadOk = 0;
+       }
+       // Check file size
+       if ($_FILES["fileToUpload"]["size"] > 500000) {
+           echo "Sorry, your file is too large.";
+           $uploadOk = 0;
+       }
+       // Check if $uploadOk is set to 0 by an error
+       if ($uploadOk == 0) {
+           echo "Sorry, your file was not uploaded.";
+       // if everything is ok, try to upload file
+       } else {
+           if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
+               echo "The file ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded.";
+           } else {
+               echo "Sorry, there was an error uploading your file.";
+           }
+       }
+       echo exec("php-cli  main.php");
+?>
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+       <form action="upload.php" method="post" enctype="multipart/form-data">
+               Select file to upload:
+               <input type="file" name="fileToUpload" id="fileToUpload">
+               <input type="submit" value="Upload" name="submit">
+       </form>
+</body>
diff --git a/public_html/prova.php~ b/public_html/prova.php~
new file mode 100755 (executable)
index 0000000..0f7fcaa
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+       $target_dir = "esercizi/";
+       $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
+       $uploadOk = 1;
+       $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
+       // Check if image file is a actual image or fake image
+       /*if(isset($_POST["submit"])) {
+           $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
+           if($check !== false) {
+               echo "File is an image - " . $check["mime"] . ".";
+               $uploadOk = 1;
+           } else {
+               echo "File is not an image.";
+               $uploadOk = 0;
+           }
+       }*/
+       // Check if file already exists
+       if (file_exists($target_file)) {
+           echo "Sorry, file already exists.";
+           $uploadOk = 0;
+       }
+       // Check file size
+       if ($_FILES["fileToUpload"]["size"] > 500000) {
+           echo "Sorry, your file is too large.";
+           $uploadOk = 0;
+       }
+       // Allow certain file formats
+       /*if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
+       && $imageFileType != "gif" ) {
+           echo "Sorry, only JPG, JPEG, PNG & GIF files are allowed.";
+           $uploadOk = 0;
+       }*/
+       // Check if $uploadOk is set to 0 by an error
+       if ($uploadOk == 0) {
+           echo "Sorry, your file was not uploaded.";
+       // if everything is ok, try to upload file
+       } else {
+           if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
+               echo "The file ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded.";
+           } else {
+               echo "Sorry, there was an error uploading your file.";
+           }
+       }
+?>
diff --git a/public_html/prova.txt b/public_html/prova.txt
new file mode 100755 (executable)
index 0000000..28c1837
--- /dev/null
@@ -0,0 +1,2 @@
+mi sei riuscito a scaricare
+
diff --git a/public_html/prova.txt~ b/public_html/prova.txt~
new file mode 100755 (executable)
index 0000000..e69de29
diff --git a/public_html/serverRequest.php b/public_html/serverRequest.php
new file mode 100755 (executable)
index 0000000..9f7a781
--- /dev/null
@@ -0,0 +1,54 @@
+<?php
+       include 'util.php';
+       $data = file_get_contents('php://input'); /*file_get_contents:data una stringa, recupera i parametri di query. In questo caso viene presa la stringa inviata come dato dal JS*/
+       $result = json_decode($data);
+       $con=mysqli_connect("localhost","root","csc@CerCo!","logintesi");
+       if ($con==false)
+       {
+               $arr=array('result'=>"errore nella connessione al database");
+               $ris=json_encode($arr);
+               echo $ris;
+               die;
+       }
+       if($result->name=='all')
+               $str="SELECT * FROM esercizi;";
+       else
+               $str="SELECT * FROM esercizi WHERE esercizio='".$result->name."' ORDER BY esercizio;";
+       $str=mysqli_query($con,$str);
+       if (!$str)
+       {
+               $arr= array('result'=>"nessun elemento presente");
+               $ris=json_encode($arr);
+               echo $ris;
+               die;
+       }
+       $esercizi;
+       $risp=mysqli_fetch_array($str);
+       $risultati;
+       $esercizio['esercizio']=$risp['esercizio'];
+       do
+       {
+               if($esercizio['esercizio']==$risp['esercizio'])
+               {
+                       //aggiungo utenti e click ell'es corrente
+                       $risultati[]=array('id'=>$risp['id'],'utente'=>$risp['utente'],'click'=>$risp['click']);
+               }
+               else
+               {
+                       //reimposto i campi per un nuovo esercizio
+                       $esercizio['risultati']=$risultati;
+                       $esercizi[]=$esercizio;
+                       unset($esercizio);
+                       unset($risultati);
+                       $esercizio['esercizio']=$risp['esercizio'];
+                       $risultati[]=array('id'=>$risp['id'],'utente'=>$risp['utente'],'click'=>$risp['click']);
+               }
+       }while($risp=mysqli_fetch_array($str));      
+       $esercizio['risultati']=$risultati;
+       $esercizi[]=$esercizio;
+       $ex=array('esercizi'=>$esercizi);
+       unset($esercizio);
+       unset($risultati);              
+       $return_json=__json_encode($ex);
+       echo $return_json;
+?>
diff --git a/public_html/upload.php b/public_html/upload.php
new file mode 100755 (executable)
index 0000000..67c3a7a
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+       $target_dir = "esercizi/";
+       $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
+       $uploadOk = 1;
+       $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
+       // Check if image file is a actual image or fake image
+       /*if(isset($_POST["submit"])) {
+               $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
+               if($check !== false) {
+                       echo "File is an image - " . $check["mime"] . ".";
+                       $uploadOk = 1;
+               } else {
+                       echo "File is not an image.";
+                       $uploadOk = 0;
+               }
+       }*/
+       // Check if file already exists
+       if (file_exists($target_file)) {
+               echo "Sorry, file already exists.";
+               $uploadOk = 0;
+       }
+       // Check file size
+       if ($_FILES["fileToUpload"]["size"] > 500000) {
+               echo "Sorry, your file is too large.";
+               $uploadOk = 0;
+       }
+       // Allow certain file formats
+       /*if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
+       && $imageFileType != "gif" ) {
+               echo "Sorry, only JPG, JPEG, PNG & GIF files are allowed.";
+               $uploadOk = 0;
+       }*/
+       // Check if $uploadOk is set to 0 by an error
+       if ($uploadOk == 0) {
+               echo "Sorry, your file was not uploaded.";
+       // if everything is ok, try to upload file
+       } else {
+               if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
+                       echo "The file ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded.";
+               } else {
+                       echo "Sorry, there was an error uploading your file.";
+               }
+       }
+?>
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+       <form action="main.php">
+               <input type="submit" value="indietro" name="submit">
+       </form>
+</body>
diff --git a/public_html/upload.php~ b/public_html/upload.php~
new file mode 100755 (executable)
index 0000000..9cf7a77
--- /dev/null
@@ -0,0 +1,33 @@
+<?
+       // QUESTE RIGHE RENDONO LO SCRIPT COMPATIBILE CON LE VERSIONI
+       // DI PHP PRECEDENTI ALLA 4.1.0
+       if(!isset($_FILES)) $_FILES = $HTTP_POST_FILES;
+       if(!isset($_SERVER)) $_SERVER = $HTTP_SERVER_VARS;
+       /********************* VARIABILI DA SETTARE ********************/
+       // Directory dove salvare i files Uploadati ( chmod 777, percorso assoluto)
+       $upload_dir = "/home/furt/brogetto/data";
+
+       // Eventuale nuovo nome da dare al file uploadato
+       $new_name = "";
+
+       // Se $new_name è vuota, il nome sarà lo stesso del file uploadato
+       $file_name = ($new_name) ? $new_name : $_FILES["upfile"]["name"];
+
+       if(trim($_FILES["upfile"]["name"]) == "") 
+       {
+               die("Non hai indicato il file da uploadare !");
+       }
+
+       if(@is_uploaded_file($_FILES["upfile"]["tmp_name"])) {
+
+       @move_uploaded_file($_FILES["upfile"]["tmp_name"], $upload_dir."/".$file_name) 
+       or die("Impossibile spostare il file, controlla l’esistenza o i permessi della directory dove fare l’upload.");
+
+       } else {
+
+       die("Problemi nell’upload del file" . $_FILES["upfile"]["name"]);
+
+       }
+
+       echo "L’upload del file" . $_FILES["upfile"]["name"] . "è avvenuto correttamente";
+?>
diff --git a/public_html/util.php b/public_html/util.php
new file mode 100755 (executable)
index 0000000..0c7fbec
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+function __json_encode($data) {
+        if (is_array ( $data ) || is_object ( $data )) {
+                $islist = is_array ( $data ) && (empty ( $data ) || array_keys ( $data ) === range ( 0, count ( $data ) - 1 ));
+
+                if ($islist) {
+                        $json = '[' . implode ( ',', array_map ( '__json_encode', $data ) ) . ']';
+                } else {
+                        $items = Array ();
+                        foreach ( $data as $key => $value ) {
+                                $items [] = __json_encode ( "$key" ) . ':' . __json_encode ( $value );
+                        }
+                        $json = '{' . implode ( ',', $items ) . '}';
+                }
+        } elseif (is_string ( $data )) {
+                $json = '"' . addcslashes ( $data, '\\"' ) . '"';
+        } else {
+                // int, floats, bools, null
+                $json = strtolower ( var_export ( $data, true ) );
+        }
+        return $json;
+}
+
+function GET_check()
+{
+if (!isset($_GET['scope']) or !isset($_GET['type']) or !($_GET['lat']) or !isset($_GET['lng']) or !isset($_GET['radius']) or !isset($_GET['timemin']) or !isset($_GET['timemax']) or !isset($_GET['status']))
+       return false;
+else return true;
+}
+function POST_check($params)
+{
+if (!$params->type or !$params->lat or !$params->lng) return false;
+else return true;
+}
+
+function NOTIFY_check($params)
+{
+if (!$params->event_id or !$params->lat or !$params->lng or !$params->status) return false;
+else return true;
+}
+?>
diff --git a/public_html/xmlPharse.php b/public_html/xmlPharse.php
new file mode 100755 (executable)
index 0000000..6dbe115
--- /dev/null
@@ -0,0 +1,11 @@
+<?php
+       include 'util.php';
+       $xml = simplexml_load_file('/projects/logicplayer/Server/server/tesi/src/com/company/esercizi.xml');
+       $esercizi;
+       foreach($xml->esercizio as $esercizio)
+       {
+               $esercizi['esercizi'][]="$esercizio";
+       }
+       $return_json=__json_encode($esercizi);
+       echo $return_json;
+?>