Teading a text file using FileReader

Main.java:

import java.io.*;
 
public class Main
{
   public static void main(String []args) {
      if (args.length != 1) {
         System.out.println("Usage: java Main <textfile>");
         System.exit(1);
      }
   
      try {
         BufferedReader br = new BufferedReader(new FileReader(args[0]));
         String line;
         StringBuffer total = new StringBuffer();
         while ((line = br.readLine()) != null) {
            total.append(line);
            total.append(System.getProperty("line.separator"));
         }
         System.out.println(total);
 
         br.close();
      }
      catch(FileNotFoundException e) {
         e.printStackTrace();
      }
      catch(IOException e) {
         e.printStackTrace();
      }
   }
}