public StreamedContent getImageFile() throws ServiceBusinessException {
StreamedContent content = null;
if (FacesUtil.getFacesContext().getRenderResponse()) {
content = new DefaultStreamedContent();
} else {
String filePath = FacesUtil.getExternalContext().getRequestParameterMap().get("filePath");
byte[] fileFromServer = serviceUtil.getFileFromServer(filePath);
if (fileFromServer != null) {
content = new DefaultStreamedContent(new ByteArrayInputStream(fileFromServer));
} else {
content = new DefaultStreamedContent();
}
}
return content;
}