Changed the configuration parser
The usage of \\z delimeter is mustableandroid-scanner
parent
7b937cc754
commit
6161898805
|
@ -75,11 +75,11 @@ public class Converter {
|
||||||
}
|
}
|
||||||
|
|
||||||
VotingBoothConfiguration config = GetVotingBoothJsonConfiguration(configurationPath);
|
VotingBoothConfiguration config = GetVotingBoothJsonConfiguration(configurationPath);
|
||||||
System.out.print("yeyyy");
|
|
||||||
ConvertJsonIntoBinaryFile(config, outputPath);
|
ConvertJsonIntoBinaryFile(config, outputPath);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
System.out.println("Exception thrown: " + e + ", " + e.getMessage());
|
System.out.println("Exception thrown: " + e + ", " + e.getMessage());
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ public class VotingBoothConfigurationCreator {
|
||||||
* @throws JSONException will be thrown if the parsing will fail
|
* @throws JSONException will be thrown if the parsing will fail
|
||||||
*/
|
*/
|
||||||
private JSONArray getJsonFromPath(String path) throws FileNotFoundException, JSONException {
|
private JSONArray getJsonFromPath(String path) throws FileNotFoundException, JSONException {
|
||||||
String content = new Scanner(new File(path)).next();
|
String content = new Scanner(new File(path)).useDelimiter("\\Z").next();
|
||||||
JSONObject jsonObject = new JSONObject(content);
|
JSONObject jsonObject = new JSONObject(content);
|
||||||
this.logger.debug("Created json object from from configuration path.");
|
this.logger.debug("Created json object from from configuration path.");
|
||||||
return (JSONArray)jsonObject.get("questions");
|
return (JSONArray)jsonObject.get("questions");
|
||||||
|
|
Loading…
Reference in New Issue