JSONObject uploadedObj = new JSONObject();
results.put("uploaded", uploadedObj);
Iterator<LoadedFile> itLoadedFile = uploadedFiles.iterator();
while( itLoadedFile.hasNext() ) {
LoadedFile loadedFile = itLoadedFile.next();
logger.info("Loaded file "+loadedFile.getOriginalFileName()+ " to "+loadedFile.getFile().getName());
// Create thread to determine file type
UploadedFileInfo fileInfo = new UploadedFileInfo();
fileInfo.setOriginalFilename( loadedFile.getOriginalFileName() );
fileInfo.setUploadedFile( loadedFile.getFile() );
ProcessFileThread t = new ProcessFileThread(fileInfo, progressId, parameters, cometChannel, userPrincipal, contributions, progressTracker);
t.start();
// Add entry to results
JSONObject fileObj = new JSONObject();
fileObj.put("chained", t.getProgressId());
uploadedObj.put(loadedFile.getFile().getName(),fileObj);
}
} else {
// insert contributions record into database immediately
ContributionHandler t = new ContributionHandler(parameters, userPrincipal);
List<String> vec = parameters.get("isUpdate");