ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
PortletSession portletSession = (PortletSession) externalContext.getSession(false);
String uniqueFolderName = portletSession.getId();
org.primefaces.model.UploadedFile uploadedFile = fileUploadEvent.getFile();
UploadedFileWrapper uploadedFileWrapper = new UploadedFileWrapper(uploadedFile,
UploadedFile.Status.FILE_SAVED, uniqueFolderName);
usersModelBean.setUploadedFile(uploadedFileWrapper);
logger.debug("Received fileName=[{0}] absolutePath=[{1}]", uploadedFileWrapper.getName(),
uploadedFileWrapper.getAbsolutePath());
}
catch (Exception e) {
logger.error(e);
LiferayFacesContext liferayFacesContext = LiferayFacesContext.getInstance();