All pastes #194132 Raw Edit

Anonymous

public text v1 · immutable
·published 2006-10-07 15:59 UTC
rendered paste body
import java.io.*;

public class configGetter {
   private static String firstLine = null;


   public static String retType() {
     FileReader reader = null;

     try {
        reader = new FileReader("gameConfiguration.txt");
     }
     catch (FileNotFoundException e) {
        System.err.println("File does not exist , using defaultGameConfiguration");

     }

     BufferedReader buffReader = new BufferedReader(reader);
     String input = null;

     do {
        try {
            input = buffReader.readLine();
        }
        catch (IOException e) {
            System.err.println("IO error");
            e.getMessage();
            System.exit(1);
        }

            firstLine=input;

        }while(input != null);

      return firstLine;
   }

   public static void main(String[] args) {
     System.out.println( retType());
   }
}