01: package net.sf.mockcreator.utils;
02:
03: import java.io.FileReader;
04: import java.io.IOException;
05: import java.io.LineNumberReader;
06:
07: public class Utility {
08:
09: public static String getFirstLine(String fileName) {
10: LineNumberReader lnr = null;
11: try {
12: lnr = new LineNumberReader(new FileReader(fileName));
13: return lnr.readLine();
14: } catch (Exception ex) {
15: return null;
16: } finally {
17: if (lnr != null) {
18: try {
19: lnr.close();
20: } catch (IOException e) {
21: }
22: }
23: }
24: }
25: }
|