@@ -763,7 +763,7 @@ protected String doInBackground(String... arg0) {
763763 publishProgress ("\n Unfortunately, no scenarios found for your device ..." );
764764 return null ;
765765 }
766-
766+ String localAppPath = AppConfigService . getLocalAppPath () + File . separator + "openscience" + File . separator ;
767767 for (int i = 0 ; i < scenarios .length (); i ++) {
768768 JSONObject scenario = scenarios .getJSONObject (i );
769769 final String module_uoa = scenario .getString ("module_uoa" );
@@ -845,7 +845,6 @@ public void println(String text) {
845845 // copyToAppSpace is not mandatory
846846 }
847847 if (copyToAppSpace != null && copyToAppSpace .equalsIgnoreCase ("yes" )) {
848- String localAppPath = AppConfigService .getLocalAppPath () + File .separator + "openscience" + File .separator ;
849848 String fileAppDir = localAppPath + file .getString ("path" );
850849 File appfp = new File (fileAppDir );
851850 if (!appfp .exists ()) {
@@ -937,7 +936,14 @@ public void println(String text) {
937936
938937 if (openCLlibPath != null ) {
939938 libPath = libPath + ":" + openCLlibPath ;
940- viennaclCachePath = AppConfigService .getLocalAppPath () + File .separator + "openscience" + File .separator + "viennacl_cache" + File .separator ;
939+ viennaclCachePath = localAppPath + File .separator + "viennacl_cache" + File .separator ;
940+ File appfp = new File (viennaclCachePath );
941+ if (!appfp .exists ()) {
942+ if (!appfp .mkdirs ()) {
943+ publishProgress ("\n Error creating dir (" + viennaclCachePath + ") ..." );
944+ return null ;
945+ }
946+ }
941947
942948 }
943949 String [] scenarioEnv = {
@@ -1021,12 +1027,13 @@ public void run() {
10211027 publishProgress ("\n Recognition result:" + recognitionRawResultText );
10221028
10231029
1024-
1025- String [] lsCacheResult = openme .openme_run_program ("ls " + viennaclCachePath , null , viennaclCachePath );
1026- if (!lsCacheResult [0 ].isEmpty ()) {
1027- publishProgress (" * ViennaCL cache dir " + lsCacheResult [0 ]);
1028- } else {
1029- publishProgress ("ViennaCL cache dir not inited " );
1030+ if (viennaclCachePath != null && !viennaclCachePath .trim ().equals ("" )) {
1031+ String [] lsCacheResult = openme .openme_run_program ("ls " + viennaclCachePath , null , viennaclCachePath );
1032+ if (!lsCacheResult [1 ].isEmpty ()) {
1033+ publishProgress ("ViennaCL cache generated " + lsCacheResult [1 ]);
1034+ } else {
1035+ publishProgress ("ViennaCL cache not generated" );
1036+ }
10301037 }
10311038
10321039
0 commit comments