Reads a file. @param fileName the name of the file @return the file contents as a String
(String fileName)
| 1058 | * @return the file contents as a String |
| 1059 | */ |
| 1060 | protected String read(String fileName) { |
| 1061 | File file = new File(fileName); |
| 1062 | StringBuffer buffer = null; |
| 1063 | try { |
| 1064 | BufferedReader in = new BufferedReader(new FileReader(file)); |
| 1065 | buffer = new StringBuffer(); |
| 1066 | String line = in.readLine(); |
| 1067 | while(line!=null) { |
| 1068 | buffer.append(line+XML.NEW_LINE); |
| 1069 | line = in.readLine(); |
| 1070 | } |
| 1071 | in.close(); |
| 1072 | return buffer.toString(); |
| 1073 | } catch(IOException ex) { |
| 1074 | logger.warning(ex.toString()); |
| 1075 | return ""; |
| 1076 | } |
| 1077 | } |
| 1078 | |
| 1079 | /** |
| 1080 | * Singleton logging frame. |