// calculated by the eclipse callback
StringBuilder sb = new StringBuilder();
sb.append("The file ");
sb.append(existingFilePath);
sb.append(" does not exist");
throw new ShellException(sb.toString());
}
try {
StringBuilder sb = new StringBuilder();
FileInputStream fis = new FileInputStream(file);
InputStreamReader isr;
if (fileEncoding == null) {
isr = new InputStreamReader(fis);
} else {
isr = new InputStreamReader(fis, fileEncoding);
}
BufferedReader br = new BufferedReader(isr);
char[] buffer = new char[1024];
int returnedBytes = br.read(buffer);
while (returnedBytes != -1) {
sb.append(buffer, 0, returnedBytes);
returnedBytes = br.read(buffer);
}
br.close();
return sb.toString();
} catch (IOException e) {
StringBuilder sb = new StringBuilder();
sb.append("IOException reading the file ");
sb.append(existingFilePath);
throw new ShellException(sb.toString(), e);
}
}