Rev 414 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 414 | Rev 415 | ||
|---|---|---|---|
| Line 2... | Line 2... | ||
| 2 | *
|
2 | *
|
| 3 | */
|
3 | */
|
| 4 | package br.com.swconsultoria.nfe.util; |
- | |
| - | 4 | package nfe.util; |
|
| 5 | 5 | ||
| 6 | import br.com.swconsultoria.nfe.dom.ConfiguracoesNfe; |
6 | import br.com.swconsultoria.nfe.dom.ConfiguracoesNfe; |
| 7 | import br.com.swconsultoria.nfe.dom.enuns.AmbienteEnum; |
7 | import br.com.swconsultoria.nfe.dom.enuns.AmbienteEnum; |
| 8 | import br.com.swconsultoria.nfe.dom.enuns.DocumentoEnum; |
8 | import br.com.swconsultoria.nfe.dom.enuns.DocumentoEnum; |
| 9 | import br.com.swconsultoria.nfe.dom.enuns.EstadosEnum; |
9 | import br.com.swconsultoria.nfe.dom.enuns.EstadosEnum; |
| Line 58... | Line 58... | ||
| 58 | if (ObjetoUtil.verifica(config.getArquivoWebService()).isPresent()) { |
58 | if (ObjetoUtil.verifica(config.getArquivoWebService()).isPresent()) { |
| 59 | File arquivo = new File(config.getArquivoWebService()); |
59 | File arquivo = new File(config.getArquivoWebService()); |
| 60 | if (!arquivo.exists()) |
60 | if (!arquivo.exists()) |
| 61 | throw new FileNotFoundException("Arquivo WebService" + config.getArquivoWebService() + " não encontrado"); |
61 | throw new FileNotFoundException("Arquivo WebService" + config.getArquivoWebService() + " não encontrado"); |
| 62 | is = new FileInputStream(arquivo); |
62 | is = new FileInputStream(arquivo); |
| 63 | log.info("[ARQUIVO INI CUSTOMIZADO]: " + config.getArquivoWebService()); |
- | |
| - | 63 | logger.info("[ARQUIVO INI CUSTOMIZADO]: " + config.getArquivoWebService()); |
|
| 64 | } else { |
64 | } else { |
| 65 | is = WebServiceUtil.class.getResourceAsStream("/WebServicesNfe.ini"); |
65 | is = WebServiceUtil.class.getResourceAsStream("/WebServicesNfe.ini"); |
| 66 | }
|
66 | }
|
| 67 | 67 | ||
| 68 | Wini ini = new Wini(); |
68 | Wini ini = new Wini(); |
| Line 113... | Line 113... | ||
| 113 | url = ini.get(secao, tipoServico.getServico().toLowerCase()); |
113 | url = ini.get(secao, tipoServico.getServico().toLowerCase()); |
| 114 | 114 | ||
| 115 | ObjetoUtil.verifica(url).orElseThrow(() -> new NfeException( |
115 | ObjetoUtil.verifica(url).orElseThrow(() -> new NfeException( |
| 116 | "WebService de " + tipoServico + " não encontrado para " + config.getEstado().getNome())); |
116 | "WebService de " + tipoServico + " não encontrado para " + config.getEstado().getNome())); |
| 117 | 117 | ||
| 118 | log.info("[URL]: " + tipoServico + ": " + url); |
- | |
| - | 118 | logger.info("[URL]: " + tipoServico + ": " + url); |
|
| 119 | 119 | ||
| 120 | return url; |
120 | return url; |
| 121 | 121 | ||
| 122 | } catch (IOException e) { |
122 | } catch (IOException e) { |
| 123 | throw new NfeException(e.getMessage(),e); |
123 | throw new NfeException(e.getMessage(),e); |