@@ -0,0 +1,1394 @@
+package fi.bittiraha.util;%0A%0Aimport java.util.*;%0A%0A/**%0A * Property file reader which contains handy content validation and%0A * shortcuts for common data types. Best practise is to load%0A * configuration file and then run getter for each parameter in use in%0A * a try block to catch validation errors. Then you can safely use%0A * getters without fear of validation errors.%0A */ %0Apublic class ConfigFile extends Properties %7B%0A%0A    public ConfigFile() %7B%0A    %7D%0A    %0A    public ConfigFile(Properties defaults) %7B%0A%09super(defaults);%0A    %7D%0A%0A    public boolean getBoolean(String k) %7B%0A%09String v = super.getProperty(k);%0A%09if (v == null) throw new ConfigFieldException(k,%22is null%22);%0A%09switch (v.toLowerCase()) %7B%0A%09case %221%22: return true;%0A%09case %220%22: return false;%0A%09case %22true%22: return true;%0A%09case %22false%22: return false;%0A%09default: throw new ConfigFieldException(k,%22is not boolean (true, false, 0, or 1)%22);%0A%09%7D%0A%0A    %7D%0A%0A    public String getString(String k) %7B%0A%09String v = super.getProperty(k);%0A%09if (v == null) throw new ConfigFieldException(k,%22is null%22);%0A%09return v;%0A    %7D%0A    %0A    /**%0A     * Validation excption. This is runtime exception so remember to%0A     * check exceptions if you don't want to exit in case of an error.%0A     */%0A    public static class ConfigFieldException extends RuntimeException %7B%0A%09public ConfigFieldException(String k, String msg) %7B%0A%09    super(%22Key %22+k+%22 %22+msg+%22 in configuration file%22);%0A%09%7D%0A    %7D%0A%7D%0A

Add config file parser class