try {
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date formattedFromDate = dateFormat.parse(fromDate);
Date formattedToDate = dateFormat.parse(toDate);
List<AiravataExperiment> airavataExperimentList = airavataRegistry.getExperiments(projectName, formattedFromDate, formattedToDate);
ExperimentList experimentList = new ExperimentList();
AiravataExperiment[] experiments = new AiravataExperiment[airavataExperimentList.size()];
for (int i = 0; i < airavataExperimentList.size(); i++) {
experiments[i] = airavataExperimentList.get(i);
}
experimentList.setExperiments(experiments);
if (airavataExperimentList.size() != 0) {
Response.ResponseBuilder builder = Response.status(Response.Status.OK);
builder.entity(experimentList);
return builder.build();
} else {