1717
1818import static Server .CustomObjects .LogType .ERROR ;
1919import static Server .CustomObjects .LogType .INFO ;
20- import static Server .StaticVariables .*;
2120
2221@ SpringBootApplication
2322@ RestController
2423public class SpringClass {
2524
25+ private static String initFile = "init.txt" ;
26+
2627 private static ServiceNew serviceInstance ;
2728 private static Thread serviceThread ;
2829
@@ -32,16 +33,17 @@ public class SpringClass {
3233 private String TAG = "Spring-Thread" ;
3334
3435 public static void main (String [] args ) throws IOException {
35-
3636 // just standard inits for the Variables used in this Project
3737 // most of them are read from the init.txt
3838 // but more of that in the OHDM wiki
39+
40+ new StaticVariables ("init.txt" );
3941 StaticVariables .init ();
4042 StaticVariables .createStdFilesAndDirs ();
4143
4244 // Logger is a singleton Class due to the availability need
4345 // the Logger is a System in itself
44- new Logger ();
46+ new Logger (StaticVariables . logDefaultDir , StaticVariables . maxLogFileSize , StaticVariables . logTerminalOutput );
4547 Logger .instance .start ();
4648
4749 // the service instance, which just goes through a couple of lists and sets things to what they are
@@ -52,12 +54,12 @@ public static void main(String[] args) throws IOException {
5254 serviceThread .start ();
5355
5456 // the ftp service, which allows the Android App to download the .map files
55- ftpInstance = new FTPService ();
57+ ftpInstance = new FTPService (StaticVariables . ftpPort , StaticVariables . ftpServiceUserPropertiesFile , StaticVariables . standardUserName , StaticVariables . standardUserPassword , StaticVariables . ftpServiceMapDir , StaticVariables . ftpDefaultDir );
5658 ftpThread = new Thread (ftpInstance );
5759 ftpThread .start ();
5860
5961 // and here starts the Spring Application with the server port set to the
60- // before given Port in StaticVariables
62+ // before given Port in Server. StaticVariables
6163 System .getProperties ().put ("server.port" , StaticVariables .webPort );
6264 SpringApplication .run (SpringClass .class , args );
6365 }
@@ -120,7 +122,7 @@ public String webServiceStatus() {
120122 sb .append (" | ----------------------------------------------------------------------" +"<br>" );
121123 sb .append (" | - Date : " + r .getDate () + "<br>" );
122124 sb .append (" | - Coords : \n " + r .getPrintableCoordsString () + "<br>" );
123- sb .append (" | - Link to download .map file : <a href=\" ftp:" + standardUserName + ":" +standardUserPassword + "@141.45.146.200:5000/" + r .getMapName ()+ ".map\" >direct link</a> <br>" );
125+ sb .append (" | - Link to download .map file : <a href=\" ftp:" + StaticVariables . standardUserName + ":" + StaticVariables . standardUserPassword + "@141.45.146.200:5000/" + r .getMapName ()+ ".map\" >direct link</a> <br>" );
124126 sb .append (" | ---------------------------------------------------------------------</p>" );
125127 i ++;
126128 }
@@ -151,7 +153,7 @@ public String request(@RequestParam(value = "name", defaultValue = "testRequest"
151153 }
152154
153155 // TODO : add id system
154- q = new QueryRequest (coordinates , date , mapname , 0000 );
156+ q = new QueryRequest (coordinates , date , mapname ,0000 , StaticVariables . osmDir , StaticVariables . mapDir );
155157
156158 Logger .instance .addLogEntry (INFO , TAG ,"given Data: " + mapname + " | Date: " + date + " | coords: \n " + q .getPrintableCoordsString ());
157159
@@ -254,8 +256,8 @@ public String sanitize_mapName(String nme) {
254256 * @return true if existent, false if not
255257 */
256258 public boolean map_exist (String nme ) {
257- File fOSM = new File (osmDir + nme );
258- File fMAP = new File (mapDir + nme );
259+ File fOSM = new File (StaticVariables . osmDir + nme );
260+ File fMAP = new File (StaticVariables . mapDir + nme );
259261
260262 if (!(fOSM .exists () && !fOSM .isDirectory ()))
261263 if (!(fMAP .exists () && !fOSM .isDirectory ()))
0 commit comments