*
* @param event
* the file upload event
*/
public void uploadCollectionProfile(final FileUploadEvent event) {
UploadedFile item = event.getUploadedFile();
String fileName = item.getName();
log.debug("Collection Profile file {} uploaded", fileName);
if (!fileName.endsWith(".xml")) {
log.warn("The uploaded file {} is not an xml file", fileName);
facesMessages.addError("The uploaded file is not an xml");
return;
}
try {
this.defineSamples.readProfile(item.getInputStream(), repositoryUsername, repositoryPassword);
} catch (ParserException e) {
log.warn("An error occurred during parsing", e);
this.facesMessages.addError("An error occurred while reading the uploaded profile: " + e.getMessage());
} catch (PlanningException e) {
log.warn("An error occurred during parsing", e);