static String votes_valid_filename;
static String votes_bad_filename;
static String results_filename;
public static void load() {
DataConfiguration config;
try {
config = new DataConfiguration(new PropertiesConfiguration(
"config.properties"));
smsDirectory = config.getString("smsdirectory");
countrycode = config.getString("countrycode");
voidOnRepeat = config.getBoolean("voidOnRepeatVote", false);
sql = config.getBoolean("connectToSQL", false);
logVotes = config.getBoolean("logVotes", false);
if(logVotes){
votes_valid_filename = config.getString("votes_valid_filename", "votes_valid.txt");
votes_bad_filename = config.getString("votes_bad_filename", "votes_bad.txt");
}
if (sql) {
db = new DB();
numQuestions = DB.qID.size();
qOpts = new ArrayList<Integer>(numQuestions);
for(int j = 0; j < numQuestions; j++){
qOpts.add(0);
}
for(int i = 0; i < numQuestions;i++){
int qid = DB.qID.get(i);
ArrayList<Integer> opts = DB.optID.get(qid);
qOpts.set(i, opts.size());
}
}
else {
qOpts = config.getList(Integer.class, "questionOptions");
if (qOpts.size() > 5) {
throw new ConfigurationException(
"Too many questions; maximum 5 supported");
}
for(int i:qOpts){