diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioArquivoBGMController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioArquivoBGMController.java index c35e7c222..cec007f54 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioArquivoBGMController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioArquivoBGMController.java @@ -89,20 +89,26 @@ public class RelatorioArquivoBGMController extends MyGenericForwardComposer { String fileZip = BGMApplication.getInstance().executaExportacao(datInicial.getValue(), datFinal.getValue(), System.getProperty("jboss.server.log.dir") , empresaId, puntoVentaId, con,this.getPathExternoGravacaoArquivo()); - try{ - FileInputStream inputStream; - File filez = new File(fileZip); - log.info(filez.exists()); - if (filez.exists()) { - log.debug("download dos arquivos"); - inputStream = new FileInputStream(filez); - Filedownload.save(inputStream, new MimetypesFileTypeMap().getContentType(filez), filez.getName()); + if(this.getPathExternoGravacaoArquivo() != null){ + Messagebox.show(Labels.getLabel("relatorioArquivoBGMController.arquivoGeradoNoServidor.value"), + Labels.getLabel("relatorioArquivoBGMController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + }else{ + try{ + FileInputStream inputStream; + File filez = new File(fileZip); + log.info(filez.exists()); + if (filez.exists()) { + log.debug("download dos arquivos"); + inputStream = new FileInputStream(filez); + Filedownload.save(inputStream, new MimetypesFileTypeMap().getContentType(filez), filez.getName()); + } + filez.delete(); + + } finally { + con.close(); } - filez.delete(); - - } finally { - con.close(); - } + } } private String getPathExternoGravacaoArquivo(){