}
protected String loadScript(String scriptFile, ResourceLoader resourceLoader) throws ConfigurationLoadException {
URL url = resourceLoader.getResource(scriptFile);
if (url == null) {
throw new ConfigurationLoadException(scriptFile);
}
InputStream inputStream;
try {
inputStream = url.openStream();
} catch (IOException e) {
throw new ConfigurationLoadException(scriptFile, e);
}
try {
StringBuilder sb = new StringBuilder(1024);
int n;
while ((n = inputStream.read()) != -1) {
sb.append((char) n);
}
return sb.toString();
} catch (IOException e) {
throw new ConfigurationLoadException(scriptFile, e);
} finally {
try {
inputStream.close();
} catch (IOException e) {
// ignore