Rev 200 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 200 | Rev 204 | ||
|---|---|---|---|
| Line 9... | Line 9... | ||
| 9 | import javax.inject.Named; |
9 | import javax.inject.Named; |
| 10 | import javax.persistence.Transient; |
10 | import javax.persistence.Transient; |
| 11 | import javax.servlet.ServletContext; |
11 | import javax.servlet.ServletContext; |
| 12 | 12 | ||
| 13 | import org.primefaces.event.FileUploadEvent; |
13 | import org.primefaces.event.FileUploadEvent; |
| 14 | import org.primefaces.model.UploadedFile; |
- | |
| - | 14 | import org.primefaces.model.file.UploadedFile; |
|
| 15 | import org.springframework.context.annotation.Scope; |
15 | import org.springframework.context.annotation.Scope; |
| 16 | 16 | ||
| 17 | import br.com.ec.core.exception.NegocioException; |
17 | import br.com.ec.core.exception.NegocioException; |
| 18 | import br.com.ec.core.util.ArquivoUtil; |
18 | import br.com.ec.core.util.ArquivoUtil; |
| 19 | import br.com.ec.core.util.VerificadorUtil; |
19 | import br.com.ec.core.util.VerificadorUtil; |
| Line 200... | Line 200... | ||
| 200 | }
|
200 | }
|
| 201 | }
|
201 | }
|
| 202 | 202 | ||
| 203 | private FotoDTO gerarArquivo(UploadedFile file) { |
203 | private FotoDTO gerarArquivo(UploadedFile file) { |
| 204 | FotoDTO arquivo = new FotoDTO(); |
204 | FotoDTO arquivo = new FotoDTO(); |
| 205 | arquivo.setArquivo(file.getContents()); |
- | |
| - | 205 | arquivo.setArquivo(file.getContent()); |
|
| 206 | arquivo.setDescricao(file.getFileName()); |
206 | arquivo.setDescricao(file.getFileName()); |
| 207 | arquivo.setExtensao(ArquivoUtil.retornarExtensaoDoArquivo(file.getFileName())); |
207 | arquivo.setExtensao(ArquivoUtil.retornarExtensaoDoArquivo(file.getFileName())); |
| 208 | return arquivo; |
208 | return arquivo; |
| 209 | }
|
209 | }
|
| 210 | 210 | ||