Exemple #1
0
 /**
  * Reads the timelog.txt and returns its content as a Report-Object.
  *
  * @return Report
  */
 private static Report importFromFile() {
   Report report = new Report();
   try {
     BufferedReader br = new BufferedReader(new FileReader(file));
     String line;
     line = br.readLine();
     while (line != null) {
       report.addLogEntry(line);
       line = br.readLine();
     }
     br.close();
   } catch (FileNotFoundException e) {
     System.out.println("Could not find " + file);
     e.printStackTrace();
   } catch (IOException e) {
     System.out.println("Could not open " + file);
     e.printStackTrace();
   }
   return report;
 }