try {
while ((line = reader.readLine()) != null) {
sb.append(line + "\n");
}
} catch (IOException e) {
throw new TestingException(e, ResponseCode.InternalError,
TestingExceptionErrorCodeEnum.GENERIC);
} finally {
try {
reader.close();
} catch (IOException e) {
logger
.log(Level.WARNING, "Failed to close input stream",
e);
// Swallow it in case the it overrides the main exception
}
}
IDD idd = new IDD();
idd.setName(name);
idd.setContent(sb.toString());
return idd;
}
logger.log(Level.FINE, "IDD %s not found", "idd/" + name);
throw new TestingException(ResponseCode.NotFound,
TestingExceptionErrorCodeEnum.NOT_FOUND);
}