Search in sources :

Example 1 with BASE64DecodedMultipartFile

use of sic.util.BASE64DecodedMultipartFile in project sic by belluccifranco.

the class EmpresaServiceImpl method guardarLogo.

@Override
public String guardarLogo(byte[] imagen) {
    try {
        String filename = String.valueOf(new Date().getTime());
        MultipartFile file = new BASE64DecodedMultipartFile(imagen, filename);
        return amazonService.saveFileIntoS3Bucket(filename, file.getInputStream(), file.getContentType());
    } catch (IOException ex) {
        LOGGER.error(ex.getMessage());
        throw new BusinessServiceException(ResourceBundle.getBundle("Mensajes").getString("mensaje_error_IOException"));
    }
}
Also used : BASE64DecodedMultipartFile(sic.util.BASE64DecodedMultipartFile) BASE64DecodedMultipartFile(sic.util.BASE64DecodedMultipartFile) MultipartFile(org.springframework.web.multipart.MultipartFile) BusinessServiceException(sic.service.BusinessServiceException) IOException(java.io.IOException) Date(java.util.Date)

Aggregations

IOException (java.io.IOException)1 Date (java.util.Date)1 MultipartFile (org.springframework.web.multipart.MultipartFile)1 BusinessServiceException (sic.service.BusinessServiceException)1 BASE64DecodedMultipartFile (sic.util.BASE64DecodedMultipartFile)1