public class StorageServiceImpl implements StorageService {
private static final Logger logger = LoggerFactory.getLogger(StorageServiceImpl.class);
public class StorageServiceImpl implements StorageService {
private static final Logger logger = LoggerFactory.getLogger(StorageServiceImpl.class);
throw new StorageException(
"StorageServiceImpl.checkZipFile: Failed to store empty file " + file.getOriginalFilename());
}
throw new StorageException(
"StorageServiceImpl.checkZipFile: Failed to store empty file " + file.getOriginalFilename());
}
logger.debug("StorageServiceImpl.checkZipFile: store the widget to:" + fileLocation);
convFile = new File(fileLocation);
try(FileOutputStream fos = new FileOutputStream(convFile)){
fos.write(file.getBytes());
}
logger.debug("StorageServiceImpl.checkZipFile: store the widget to:" + fileLocation);
convFile = new File(fileLocation);
try(FileOutputStream fos = new FileOutputStream(convFile)){
fos.write(file.getBytes());
}
convFile.delete();
} catch (IOException e) {
logger.error("StorageServiceImpl.checkZipFile: Failed to store file " + file.getOriginalFilename(), e);
convFile.delete();
} catch (IOException e) {
logger.error("StorageServiceImpl.checkZipFile: Failed to store file " + file.getOriginalFilename(), e);