DateFormat df = DateFormat.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("dd'/'MM'/'yyyy");
    public static void readInput(String input)        throws IOException, ParseException    {        FileReader fr = null;        BufferedReader br = null;                // read in the analysis information, throwing an error if we fail to open        // the given file        String record = null;        try         {              fr = new FileReader(input);            br = new BufferedReader(fr);        }         catch (IOException e)         {              System.out.println("Failed to read input file");            System.exit(0);        }                 // FIXME: although this works, it is not very elegant        // loop through the aggregator file and read in the values        while ((record = br.readLine()) != null)         {            // match real lines            Matcher matchReal = real.matcher(record);                        // pre-prepare our input strings            String section = null;            String key = null;            String value = null;                        // temporary string to hold the left hand side of the equation            String left = null;                        // match the line or skip this record            if (matchReal.matches())            {                // lift the values out of the matcher's result groups                left = matchReal.group(1).trim();                value = matchReal.group(2).trim();                                // now analyse the left hand side, splitting by ".", taking the                // first token as the section and the remainder of the string                // as they key if it exists                StringTokenizer tokens = new StringTokenizer(left, ".");                int numTokens = tokens.countTokens();                if (tokens.hasMoreTokens())                {                    section = tokens.nextToken();                    if (numTokens > 1)                    {                        key = left.substring(section.length() + 1);                    }                    else                    {                        key = "";                    }                }            }            else            {                continue;            }                        // if the line is real, then we carry on                        // first initialise a date format object to do our date processing            // if necessary            DateFormat df = DateFormat.getInstance();                        // read the analysis contents in            if (section.equals("archive"))            {                archiveStats.put(key, value);            }                        if (section.equals("action"))            {                actionAggregator.put(key, value);            }                        if (section.equals("user"))            {                userAggregator.put(key, value);            }                        if (section.equals("search"))            {                searchAggregator.put(key, value);            }                        if (section.equals("item"))            {                itemAggregator.put(key, value);            }                        // read the config details used to make this report in            if (section.equals("user_email"))            {                userEmail = value;            }                        if (section.equals("item_floor"))            {                itemFloor = Integer.parseInt(value);            }                        if (section.equals("search_floor"))            {                searchFloor = Integer.parseInt(value);            }                        if (section.equals("host_url"))            {                url = value;            }                        if (section.equals("item_lookup"))            {                itemLookup = Integer.parseInt(value);            }                        if (section.equals("avg_item_views"))            {                try                 {                    avgItemViews = Integer.parseInt(value);                }                catch (NumberFormatException e)                {                    avgItemViews = 0;                }            }                        if (section.equals("server_name"))            {                serverName = value;            }                        if (section.equals("service_name"))            {                name = value;            }                         if (section.equals("start_date"))            {                startDate = df.parse(value);            }                        if (section.equals("end_date"))            {                endDate = df.parse(value);            }                        if (section.equals("analysis_process_time"))            {                processTime = Integer.parseInt(value);            }                        if (section.equals("general_summary"))            {                generalSummary.add(value);            }                        if (section.equals("log_lines"))            {                logLines = Integer.parseInt(value);            }                        if (section.equals("warnings"))            {                warnings = Integer.parseInt(value);            }        }        // close the inputs        br.close();        fr.close();    }