From 5ffaa9928c4d2d7b88da50f1abe3f8cfec83afdd Mon Sep 17 00:00:00 2001
From: Dominique Blouin <dominique.blouin@telecom-paristech.fr>
Date: Sun, 28 Jun 2015 00:00:58 +0000
Subject: [PATCH] change sql query

---
 bin/config.xml                               |  4 ++--
 crawler/db-derby-10.11.1.1-bin/bin/derby.log | 16 ++++++++++++--
 crawler/src/web/crawler/Database_query.java  |  2 +-
 crawler/src/web/crawler/File_management.java |  6 +++--
 src/ui/window/JDialogSearchBox.java          | 23 +++++++++++++++-----
 5 files changed, 38 insertions(+), 13 deletions(-)

diff --git a/bin/config.xml b/bin/config.xml
index 329a6b521b..a0eb263799 100755
--- a/bin/config.xml
+++ b/bin/config.xml
@@ -61,9 +61,9 @@
 <ExternalCommand2Host data="localhost"/>
 <ExternalCommand2 data="/packages/uppaal(4.0.11/uppaal /home/enrici/TURTLE/uppaal/spec.xml"/>
 
-<LastOpenFile data="/home/trhuy/Downloads/CSmartCardProtocol.xml"/>
+<LastOpenFile data="/home/trhuy/Downloads/SemesterFinalResult/StuxnetModel/stuxnet_6_12_split (1).xml"/>
 
-<ExternalServer data="localhost:12345"/>
+<ExternalServer data="10.188.65.215:12345"/>
 
 <LastWindowAttributes x="90" y="25" width="1219" height="597" max="false" />
 
diff --git a/crawler/db-derby-10.11.1.1-bin/bin/derby.log b/crawler/db-derby-10.11.1.1-bin/bin/derby.log
index d6bb3dfb1c..44227b0810 100644
--- a/crawler/db-derby-10.11.1.1-bin/bin/derby.log
+++ b/crawler/db-derby-10.11.1.1-bin/bin/derby.log
@@ -1,2 +1,14 @@
-Fri Jun 19 15:15:20 CEST 2015 : Could not listen on port 1527 on host localhost:
- java.net.BindException: Address already in use
+Sat Jun 27 18:00:11 CEST 2015 : Apache Derby Network Server - 10.11.1.1 - (1616546) started and ready to accept connections on port 1527
+----------------------------------------------------------------
+Sat Jun 27 18:00:29 CEST 2015:
+Booting Derby version The Apache Software Foundation - Apache Derby - 10.11.1.1 - (1616546): instance a816c00e-014e-35bf-5eb2-000043e4831f 
+on database directory /home/trhuy/TURTLE/crawler/db-derby-10.11.1.1-bin/bin/MyDatabase with class loader sun.misc.Launcher$AppClassLoader@7451b0af 
+Loaded from file:/home/trhuy/TURTLE/crawler/db-derby-10.11.1.1-bin/lib/derby.jar
+java.vendor=Oracle Corporation
+java.runtime.version=1.7.0_79-b14
+user.dir=/home/trhuy/TURTLE/crawler/db-derby-10.11.1.1-bin/bin
+os.name=Linux
+os.arch=amd64
+os.version=3.13.0-37-generic
+derby.system.home=/home/trhuy/TURTLE/crawler/db-derby-10.11.1.1-bin/bin
+Database Class Loader started - derby.database.classpath=''
diff --git a/crawler/src/web/crawler/Database_query.java b/crawler/src/web/crawler/Database_query.java
index f917196607..b5fcaff607 100644
--- a/crawler/src/web/crawler/Database_query.java
+++ b/crawler/src/web/crawler/Database_query.java
@@ -175,7 +175,7 @@ public class Database_query {
                 + "AND VULNERABILITIES.SCORE BETWEEN ? AND ? \n"
                 + "FETCH FIRST ? ROWS ONLY";
 
-        System.out.println(querySQL);
+        //System.out.println(querySQL);
 
         PreparedStatement prep = this.database.getconn().prepareStatement(querySQL);
 
diff --git a/crawler/src/web/crawler/File_management.java b/crawler/src/web/crawler/File_management.java
index 8cce4aae88..d283ef4f6a 100644
--- a/crawler/src/web/crawler/File_management.java
+++ b/crawler/src/web/crawler/File_management.java
@@ -224,8 +224,10 @@ public class File_management {
         transformer.transform(domSource, sr);
         String out = new SimpleDateFormat("dd-MM-yy/hh-mm-ss").format(new Date());
         String xmlContent = sr.getWriter().toString();
-        boolean success = (new File(System.getProperty("user.dir")+"\\results")).mkdir();
-        File file = new File(System.getProperty("user.dir")+"\\results\\"+out+".xml");
+        //boolean success = (new File(System.getProperty("user.dir")+"\\results")).mkdir();
+        //File file = new File(System.getProperty("user.dir")+"\\results\\"+out+".xml");
+        boolean success = (new File(System.getProperty("user.dir")+"/results")).mkdirs();
+        File file = new File(System.getProperty("user.dir")+"/results/"+out+".xml");
         if (success=false) {
             System.out.println("The folder structure does not exist");
         }else {
diff --git a/src/ui/window/JDialogSearchBox.java b/src/ui/window/JDialogSearchBox.java
index 53e2df1391..dc6100b3bc 100644
--- a/src/ui/window/JDialogSearchBox.java
+++ b/src/ui/window/JDialogSearchBox.java
@@ -918,7 +918,6 @@ public class JDialogSearchBox extends javax.swing.JFrame  {
 
     }
 
-
     /**
      *
      * @param msg
@@ -1464,14 +1463,26 @@ public class JDialogSearchBox extends javax.swing.JFrame  {
      * @return a splited, then concaternated with space.
      */
     public String splitAndConcat(String input){
-        String[] splitValue = input.split("(?=\\p{Lu})");
         String value = "";
-        if (splitValue.length>0){
-            value = splitValue[0];
-            for (int i =1 ; i < splitValue.length; i ++ ){
-                value = value + " " + splitValue[i];
+        if (input.contains("_")){
+            String[] splitValue = input.split("_");
+
+            if (splitValue.length>0){
+                value = splitValue[0];
+                for (int i =1 ; i < splitValue.length; i ++ ){
+                    value = value + " " + splitValue[i];
+                }
+            }
+        }else{
+            String[] splitValue = input.split("(?=\\p{Lu})");
+            if (splitValue.length>0){
+                value = splitValue[0];
+                for (int i =1 ; i < splitValue.length; i ++ ){
+                    value = value + " " + splitValue[i];
+                }
             }
         }
+
         return value;
     }
 
-- 
GitLab