@PostConstruct public void init() { try { if (this.leilaoVO == null) { // Recupera o leilão da sessão this.leilaoVO = controladorLoginBean.getLeilaoVO(); } final FacesContext aFacesContext = FacesContext.getCurrentInstance(); final ServletContext context = (ServletContext) aFacesContext.getExternalContext().getContext(); final String caminhoFotos = LeilaoWebHelper.recuperaWorkSpace(context.getRealPath("/")) + Constantes.DIRETORIO_FOTOS_LEILAO; final String caminhoGravarFotos = context.getRealPath("/") + Constantes.DIRETORIO_FOTOS_LEILAO_BARRA_INVERTIDA; LeilaoWebHelper.gravarFotos(caminhoFotos, caminhoGravarFotos); } catch (Exception e) { LOGGER.error("Problema ao iniciar os elementos!", e); } }