if (allUploaded) {
List<FileUploadItem> filesItems = new LinkedList<FileUploadItem>();
for (int i = 0; i < files.length(); i++) {
JSONArray file = files.getJSONArray(i);
if (file.getString(3).equals("SUCCESSFUL")) {
FileUploadItem fileUploadItem = (FileUploadItem) sessionMap.get(file.getString(0));
filesItems.add(fileUploadItem);
sessionMap.remove(file.getString(0));
JSONArray jsonArray = new JSONArray();
jsonArray.put(file.getString(4));
jsonArray.put(fileUploadItem.getFile().length());
fileSizes.put(jsonArray);
} else if (file.getString(3).equals("STOPPED")) {
filesItems.add(new FileUploadItem(file.getString(2), null, FileUploadStatus.STOPPED));
sessionMap.remove(PROGRESS_ID + file.getString(1));
sessionMap.remove(FILE_SIZE_ID + file.getString(1));
} else if (file.getString(3).equals("FAILED")) {
filesItems.add(new FileUploadItem(file.getString(2), null, FileUploadStatus.FAILED));
sessionMap.remove(PROGRESS_ID + file.getString(1));
sessionMap.remove(FILE_SIZE_ID + file.getString(1));
} else if (file.getString(3).equals("SIZE_LIMIT_EXCEEDED")) {
filesItems.add(new FileUploadItem(file.getString(2), null, FileUploadStatus.SIZE_LIMIT_EXCEEDED));
sessionMap.remove(FILE_SIZE_ID + file.getString(1));
}
}
AbstractFileUpload fileUpload = (AbstractFileUpload) component;
MethodExpression completionListener = fileUpload.getCompletionListener();