Hi, i am using esclipse and my IDE, i got a little problem over here, whenever i call ClassName.getFile(fileName) however for some reason i got an error..
The source attachment does not contain the source for the file StreamEncoder.Class in rt,jar
public static String getFile(String fileName) throws IOException{
String newline = "\n";
BufferedReader inputStream = null; //Declare a Buffered Reader to read the content of the files
String line; //Declare a string variable to read everyline of a file
String content = ""; //Declare content that is to be output into the text area
try {
inputStream = new BufferedReader(new FileReader(fileName));
while ( (line = inputStream.readLine()) != null) {//if the line is not an emp ty line
if (line.trim().length() > 0){
content += line + newline;
}
}
} finally {
if (inputStream != null) {
inputStream.close();
}
}
return content;
}
i use JDK 1.5.0_11.