opt: 对象空判断和非空判断使用Objects

pull/26/head
reminis 2 years ago
parent 7382e391af
commit c3d4ac43e0

@ -23,6 +23,7 @@ import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.LinkedBlockingQueue;
/**
@ -56,7 +57,7 @@ public class CrowdBatchTaskPending extends AbstractLazyPending<CrowdInfoVo> {
for (CrowdInfoVo crowdInfoVo : crowdInfoVos) {
String receiver = crowdInfoVo.getReceiver();
Map<String, String> vars = crowdInfoVo.getParams();
if (paramMap.get(vars) == null) {
if (Objects.isNull(paramMap.get(vars))) {
paramMap.put(vars, receiver);
} else {
String newReceiver = StringUtils.join(new String[]{

@ -10,10 +10,7 @@ import com.java3y.austin.cron.vo.CrowdInfoVo;
import lombok.extern.slf4j.Slf4j;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
*
@ -97,7 +94,7 @@ public class ReadFileUtils {
List<CrowdInfoVo> result = new ArrayList<>();
try {
CsvData data = CsvUtil.getReader().read(FileUtil.file(path));
if (data == null || data.getRow(0) == null || data.getRow(1) == null) {
if (Objects.isNull(data) || Objects.isNull(data.getRow(0)) || Objects.isNull(data.getRow(1))) {
log.error("read csv file empty!,path:{}", path);
}
// 第一行为默认为头信息,所以遍历从第二行开始,第一列默认为接收者Id(不处理)

@ -6,10 +6,7 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.*;
/**
*
@ -44,7 +41,7 @@ public class XxlJobGroup {
private List<String> registryList;
public List<String> getRegistryList() {
if (addressList != null && addressList.trim().length() > 0) {
if (Objects.nonNull(addressList) && addressList.trim().length() > 0) {
registryList = new ArrayList<String>(Arrays.asList(addressList.split(",")));
}
return registryList;

@ -21,6 +21,7 @@ import java.net.HttpCookie;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* @author 3y
@ -42,7 +43,7 @@ public class CronTaskServiceImpl implements CronTaskService {
@Override
public BasicResultVO saveCronTask(XxlJobInfo xxlJobInfo) {
Map<String, Object> params = JSON.parseObject(JSON.toJSONString(xxlJobInfo), Map.class);
String path = xxlJobInfo.getId() == null ? xxlAddresses + XxlJobConstant.INSERT_URL
String path = Objects.isNull(xxlJobInfo.getId()) ? xxlAddresses + XxlJobConstant.INSERT_URL
: xxlAddresses + XxlJobConstant.UPDATE_URL;
HttpResponse response;
@ -145,7 +146,7 @@ public class CronTaskServiceImpl implements CronTaskService {
try {
response = HttpRequest.post(path).form(params).cookie(getCookie()).execute();
Integer id = JSON.parseObject(response.body()).getJSONArray("data").getJSONObject(0).getInteger("id");
if (response.isOk() && id != null) {
if (response.isOk() && Objects.nonNull(id)) {
return BasicResultVO.success(id);
}
} catch (Exception e) {

@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.Objects;
/**
* xxlJob
@ -68,7 +69,7 @@ public class XxlJobUtils {
.alarmEmail(StrUtil.EMPTY)
.childJobId(StrUtil.EMPTY).build();
if (messageTemplate.getCronTaskId() != null) {
if (Objects.nonNull(messageTemplate.getCronTaskId())) {
xxlJobInfo.setId(messageTemplate.getCronTaskId());
}
return xxlJobInfo;
@ -80,7 +81,7 @@ public class XxlJobUtils {
*/
private Integer queryJobGroupId() {
BasicResultVO basicResultVO = cronTaskService.getGroupId(appName, jobHandlerName);
if (basicResultVO.getData() == null) {
if (Objects.isNull(basicResultVO.getData())) {
XxlJobGroup xxlJobGroup = XxlJobGroup.builder().appname(appName).title(jobHandlerName).addressType(CommonConstant.FALSE).build();
if (RespStatusEnum.SUCCESS.getCode().equals(cronTaskService.createGroup(xxlJobGroup).getStatus())) {
return (int) cronTaskService.getGroupId(appName, jobHandlerName).getData();

@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
/**
* @author 3y.
@ -34,7 +35,7 @@ public class DeduplicationRuleService {
List<Integer> deduplicationList = DeduplicationType.getDeduplicationList();
for (Integer deduplicationType : deduplicationList) {
DeduplicationParam deduplicationParam = deduplicationHolder.selectBuilder(deduplicationType).build(deduplicationConfig, taskInfo);
if (deduplicationParam != null) {
if (Objects.nonNull(deduplicationParam)) {
deduplicationHolder.selectService(deduplicationType).deduplication(deduplicationParam);
}
}

@ -7,6 +7,7 @@ import com.java3y.austin.handler.deduplication.DeduplicationParam;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.PostConstruct;
import java.util.Objects;
/**
* @author 3y
@ -26,11 +27,11 @@ public abstract class AbstractDeduplicationBuilder implements Builder {
public DeduplicationParam getParamsFromConfig(Integer key, String duplicationConfig, TaskInfo taskInfo) {
JSONObject object = JSONObject.parseObject(duplicationConfig);
if (object == null) {
if (Objects.isNull(object)) {
return null;
}
DeduplicationParam deduplicationParam = JSONObject.parseObject(object.getString(DEDUPLICATION_CONFIG_PRE + key), DeduplicationParam.class);
if (deduplicationParam == null) {
if (Objects.isNull(deduplicationParam)) {
return null;
}
deduplicationParam.setTaskInfo(taskInfo);

@ -6,6 +6,8 @@ import com.java3y.austin.common.enums.DeduplicationType;
import com.java3y.austin.handler.deduplication.DeduplicationParam;
import org.springframework.stereotype.Service;
import java.util.Objects;
/**
* @author huskey
@ -21,7 +23,7 @@ public class ContentDeduplicationBuilder extends AbstractDeduplicationBuilder im
@Override
public DeduplicationParam build(String deduplication, TaskInfo taskInfo) {
DeduplicationParam deduplicationParam = getParamsFromConfig(deduplicationType, deduplication, taskInfo);
if (deduplicationParam == null) {
if (Objects.isNull(deduplicationParam)) {
return null;
}
deduplicationParam.setAnchorState(AnchorState.CONTENT_DEDUPLICATION);

@ -8,6 +8,7 @@ import com.java3y.austin.handler.deduplication.DeduplicationParam;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.Objects;
/**
* @author huskey
@ -23,7 +24,7 @@ public class FrequencyDeduplicationBuilder extends AbstractDeduplicationBuilder
@Override
public DeduplicationParam build(String deduplication, TaskInfo taskInfo) {
DeduplicationParam deduplicationParam = getParamsFromConfig(deduplicationType, deduplication, taskInfo);
if (deduplicationParam == null) {
if (Objects.isNull(deduplicationParam)) {
return null;
}
deduplicationParam.setDeduplicationTime((DateUtil.endOfDay(new Date()).getTime() - DateUtil.current()) / 1000);

@ -40,7 +40,7 @@ public class SimpleLimitService extends AbstractLimitService {
String value = inRedisValue.get(key);
// 符合条件的用户
if (value != null && Integer.parseInt(value) >= param.getCountNum()) {
if (Objects.nonNull(value) && Integer.parseInt(value) >= param.getCountNum()) {
filterReceiver.add(receiver);
} else {
readyPutRedisReceiver.put(receiver, key);
@ -64,8 +64,8 @@ public class SimpleLimitService extends AbstractLimitService {
Map<String, String> keyValues = new HashMap<>(readyPutRedisReceiver.size());
for (Map.Entry<String, String> entry : readyPutRedisReceiver.entrySet()) {
String key = entry.getValue();
if (inRedisValue.get(key) != null) {
keyValues.put(key, String.valueOf(Integer.valueOf(inRedisValue.get(key)) + 1));
if (Objects.nonNull(inRedisValue.get(key))) {
keyValues.put(key, String.valueOf(Integer.parseInt(inRedisValue.get(key)) + 1));
} else {
keyValues.put(key, String.valueOf(CommonConstant.TRUE));
}

@ -50,7 +50,7 @@ public class FlowControlFactory implements ApplicationContextAware {
Double rateInitValue = flowControlParam.getRateInitValue();
// 对比 初始限流值 与 配置限流值,以 配置中心的限流值为准
Double rateLimitConfig = getRateLimitConfig(taskInfo.getSendChannel());
if (rateLimitConfig != null && !rateInitValue.equals(rateLimitConfig)) {
if (Objects.nonNull(rateLimitConfig) && !rateInitValue.equals(rateLimitConfig)) {
rateLimiter = RateLimiter.create(rateLimitConfig);
flowControlParam.setRateInitValue(rateLimitConfig);
flowControlParam.setRateLimiter(rateLimiter);
@ -79,7 +79,7 @@ public class FlowControlFactory implements ApplicationContextAware {
private Double getRateLimitConfig(Integer channelCode) {
String flowControlConfig = config.getProperty(FLOW_CONTROL_KEY, CommonConstant.EMPTY_JSON_OBJECT);
JSONObject jsonObject = JSON.parseObject(flowControlConfig);
if (jsonObject.getDouble(FLOW_CONTROL_PREFIX + channelCode) == null) {
if (Objects.isNull(jsonObject.getDouble(FLOW_CONTROL_PREFIX + channelCode))) {
return null;
}
return jsonObject.getDouble(FLOW_CONTROL_PREFIX + channelCode);

@ -9,6 +9,8 @@ import com.java3y.austin.support.utils.LogUtils;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Objects;
/**
* @author 3y
* handler
@ -48,7 +50,7 @@ public abstract class BaseHandler implements Handler {
*/
public void flowControl(TaskInfo taskInfo) {
// 只有子类指定了限流参数,才需要限流
if (flowControlParam != null) {
if (Objects.nonNull(flowControlParam)) {
flowControlFactory.flowControl(taskInfo, flowControlParam);
}
}

@ -24,6 +24,7 @@ import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
* @author 3y
@ -79,7 +80,7 @@ public class TencentSmsScript implements SmsScript {
* @return
*/
private List<SmsRecord> assembleSendSmsRecord(SmsParam smsParam, SendSmsResponse response, TencentSmsAccount tencentSmsAccount) {
if (response == null || ArrayUtil.isEmpty(response.getSendStatusSet())) {
if (Objects.isNull(response) || ArrayUtil.isEmpty(response.getSendStatusSet())) {
return null;
}
@ -150,7 +151,7 @@ public class TencentSmsScript implements SmsScript {
*/
private List<SmsRecord> assemblePullSmsRecord(TencentSmsAccount account, PullSmsSendStatusResponse resp) {
List<SmsRecord> smsRecordList = new ArrayList<>();
if (resp != null && resp.getPullSmsSendStatusSet() != null && resp.getPullSmsSendStatusSet().length > 0) {
if (Objects.nonNull(resp) && Objects.nonNull(resp.getPullSmsSendStatusSet()) && resp.getPullSmsSendStatusSet().length > 0) {
for (PullSmsSendStatus pullSmsSendStatus : resp.getPullSmsSendStatusSet()) {
SmsRecord smsRecord = SmsRecord.builder()
.sendDate(Integer.valueOf(DateUtil.format(new Date(), DatePattern.PURE_DATE_PATTERN)))

@ -81,7 +81,7 @@ public class YunPianSmsScript implements SmsScript {
private List<SmsRecord> assembleSmsRecord(SmsParam smsParam, YunPianSendResult response, YunPianSmsAccount account) {
if (response == null || ArrayUtil.isEmpty(response.getData())) {
if (Objects.isNull(response) || ArrayUtil.isEmpty(response.getData())) {
return null;
}

@ -14,6 +14,7 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
@ -33,7 +34,7 @@ public class PreParamCheckAction implements BusinessProcess<SendTaskModel> {
List<MessageParam> messageParamList = sendTaskModel.getMessageParamList();
// 1.没有传入 消息模板Id 或者 messageParam
if (messageTemplateId == null || CollUtil.isEmpty(messageParamList)) {
if (Objects.isNull(messageTemplateId) || CollUtil.isEmpty(messageParamList)) {
context.setNeedBreak(true).setResponse(BasicResultVO.fail(RespStatusEnum.CLIENT_BAD_PARAMETERS));
return;
}

@ -21,10 +21,10 @@ public enum BusinessCode {
/** code 关联着责任链的模板 */
private String code;
private final String code;
/** 类型说明 */
private String description;
private final String description;
}

@ -3,6 +3,8 @@ package com.java3y.austin.support.exception;
import com.java3y.austin.common.enums.RespStatusEnum;
import com.java3y.austin.support.pipeline.ProcessContext;
import java.util.Objects;
/**
* @author SamLee
* @since 2022-03-29
@ -26,7 +28,7 @@ public class ProcessException extends RuntimeException {
@Override
public String getMessage() {
if (this.processContext != null) {
if (Objects.nonNull(this.processContext)) {
return this.processContext.getResponse().getMsg();
} else {
return RespStatusEnum.CONTEXT_IS_NULL.getMsg();

@ -11,6 +11,7 @@ import lombok.extern.slf4j.Slf4j;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
*
@ -66,7 +67,7 @@ public class ProcessController {
*/
private void preCheck(ProcessContext context) throws ProcessException {
// 上下文
if (context == null) {
if (Objects.isNull(context)) {
context = new ProcessContext();
context.setResponse(BasicResultVO.fail(RespStatusEnum.CONTEXT_IS_NULL));
throw new ProcessException(context);
@ -81,7 +82,7 @@ public class ProcessController {
// 执行模板
ProcessTemplate processTemplate = templateConfig.get(businessCode);
if (processTemplate == null) {
if (Objects.isNull(processTemplate)) {
context.setResponse(BasicResultVO.fail(RespStatusEnum.PROCESS_TEMPLATE_IS_NULL));
throw new ProcessException(context);
}

@ -9,6 +9,7 @@ import org.springframework.stereotype.Component;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.Objects;
/**
* @author 3y
@ -67,7 +68,7 @@ public class OkHttpUtils {
*/
public String doGet(String url, Map<String, String> params, Map<String, String> headers) {
StringBuilder sb = new StringBuilder(url);
if (params != null && params.keySet().size() > 0) {
if (Objects.nonNull(params) && params.keySet().size() > 0) {
boolean firstFlag = true;
for (String key : params.keySet()) {
if (firstFlag) {
@ -96,7 +97,7 @@ public class OkHttpUtils {
public String doPost(String url, Map<String, String> params, Map<String, String> headers) {
FormBody.Builder formBuilder = new FormBody.Builder();
if (params != null && params.keySet().size() > 0) {
if (Objects.nonNull(params) && params.keySet().size() > 0) {
for (String key : params.keySet()) {
formBuilder.add(key, params.get(key));
}

@ -14,6 +14,7 @@ import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* @author 3y
@ -170,7 +171,7 @@ public class RedisUtils {
try {
Long execute = redisTemplate.execute(redisScript, keys, args);
if (execute == null) {
if (Objects.isNull(execute)) {
return false;
}
return CommonConstant.TRUE.equals(execute.intValue());

@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Objects;
/**
* )
@ -50,7 +51,7 @@ public class DataController {
@PostMapping("/sms")
@ApiOperation("/获取短信下发数据")
public BasicResultVO getSmsData(@RequestBody DataParam dataParam) {
if (dataParam == null || dataParam.getDateTime() == null || StrUtil.isBlank(dataParam.getReceiver())) {
if (Objects.isNull(dataParam) || Objects.isNull(dataParam.getDateTime()) || StrUtil.isBlank(dataParam.getReceiver())) {
return new BasicResultVO<>(RespStatusEnum.SUCCESS, SmsTimeLineVo.builder().items(new ArrayList<>()).build());
}

@ -34,6 +34,7 @@ import java.io.File;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
@ -154,7 +155,7 @@ public class MessageTemplateController {
public BasicResultVO test(Long id) {
MessageTemplate messageTemplate = messageTemplateService.queryById(id);
CommonAmisVo commonAmisVo = Convert4Amis.getTestContent(messageTemplate.getMsgContent());
if (commonAmisVo != null) {
if (Objects.nonNull(commonAmisVo)) {
return BasicResultVO.success(commonAmisVo);
}
return BasicResultVO.success();

@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
*
@ -60,7 +61,7 @@ public class MiniProgramController {
@PostMapping("/detailTemplate")
@ApiOperation("/根据账号Id和模板ID获取模板列表")
public BasicResultVO queryDetailList(Long id, String wxTemplateId) {
if (id == null || wxTemplateId == null) {
if (Objects.isNull(id) || Objects.isNull(wxTemplateId)) {
return BasicResultVO.success(RespStatusEnum.CLIENT_BAD_PARAMETERS);
}
try {

@ -33,6 +33,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
*
@ -86,7 +87,7 @@ public class OfficialAccountController {
@PostMapping("/detailTemplate")
@ApiOperation("/根据账号Id和模板ID获取模板列表")
public BasicResultVO queryDetailList(Long id, String wxTemplateId) {
if (id == null || wxTemplateId == null) {
if (Objects.isNull(id) || Objects.isNull(wxTemplateId)) {
return BasicResultVO.success(RespStatusEnum.CLIENT_BAD_PARAMETERS);
}
try {
@ -113,7 +114,7 @@ public class OfficialAccountController {
public String receiptMessage(HttpServletRequest request) {
try {
WeChatLoginConfig configService = loginUtils.getLoginConfig();
if (configService == null) {
if (Objects.isNull(configService)) {
return RespStatusEnum.DO_NOT_NEED_LOGIN.getMsg();
}
WxMpService wxMpService = configService.getOfficialAccountLoginService();
@ -164,7 +165,7 @@ public class OfficialAccountController {
public BasicResultVO getQrCode() {
try {
WeChatLoginConfig configService = loginUtils.getLoginConfig();
if (configService == null) {
if (Objects.isNull(configService)) {
return BasicResultVO.fail(RespStatusEnum.DO_NOT_NEED_LOGIN);
}
String id = IdUtil.getSnowflake().nextIdStr();

@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
/**
* @author 3y
@ -26,7 +27,7 @@ public class ChannelAccountServiceImpl implements ChannelAccountService {
@Override
public ChannelAccount save(ChannelAccount channelAccount) {
if (channelAccount.getId() == null) {
if (Objects.isNull(channelAccount.getId())) {
channelAccount.setCreated(Math.toIntExact(DateUtil.currentSeconds()));
channelAccount.setIsDeleted(CommonConstant.FALSE);
}

@ -26,6 +26,7 @@ import org.springframework.stereotype.Service;
import javax.persistence.criteria.Predicate;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* Service
@ -74,7 +75,7 @@ public class MessageTemplateServiceImpl implements MessageTemplateService {
@Override
public MessageTemplate saveOrUpdate(MessageTemplate messageTemplate) {
if (messageTemplate.getId() == null) {
if (Objects.isNull(messageTemplate.getId())) {
initStatus(messageTemplate);
} else {
resetStatus(messageTemplate);
@ -90,7 +91,7 @@ public class MessageTemplateServiceImpl implements MessageTemplateService {
Iterable<MessageTemplate> messageTemplates = messageTemplateDao.findAllById(ids);
messageTemplates.forEach(messageTemplate -> messageTemplate.setIsDeleted(CommonConstant.TRUE));
for (MessageTemplate messageTemplate : messageTemplates) {
if (messageTemplate.getCronTaskId() != null && messageTemplate.getCronTaskId() > 0) {
if (Objects.nonNull(messageTemplate.getCronTaskId()) && messageTemplate.getCronTaskId() > 0) {
cronTaskService.deleteCronTask(messageTemplate.getCronTaskId());
}
}
@ -120,12 +121,12 @@ public class MessageTemplateServiceImpl implements MessageTemplateService {
// 3.获取taskId(如果本身存在则复用原有任务如果不存在则得到新建后任务ID)
Integer taskId = messageTemplate.getCronTaskId();
BasicResultVO basicResultVO = cronTaskService.saveCronTask(xxlJobInfo);
if (taskId == null && RespStatusEnum.SUCCESS.getCode().equals(basicResultVO.getStatus()) && basicResultVO.getData() != null) {
if (Objects.isNull(taskId) && RespStatusEnum.SUCCESS.getCode().equals(basicResultVO.getStatus()) && Objects.nonNull(basicResultVO.getData())) {
taskId = Integer.valueOf(String.valueOf(basicResultVO.getData()));
}
// 4. 启动定时任务
if (taskId != null) {
if (Objects.nonNull(taskId)) {
cronTaskService.startCronTask(taskId);
MessageTemplate clone = ObjectUtil.clone(messageTemplate).setMsgStatus(MessageStatus.RUN.getCode()).setCronTaskId(taskId).setUpdated(Math.toIntExact(DateUtil.currentSeconds()));
messageTemplateDao.save(clone);
@ -173,7 +174,7 @@ public class MessageTemplateServiceImpl implements MessageTemplateService {
messageTemplate.setUpdator(messageTemplate.getUpdator())
.setMsgStatus(MessageStatus.INIT.getCode()).setAuditStatus(AuditStatus.WAIT_AUDIT.getCode());
if (messageTemplate.getCronTaskId() != null && TemplateType.CLOCKING.getCode().equals(messageTemplate.getTemplateType())) {
if (Objects.nonNull(messageTemplate.getCronTaskId()) && TemplateType.CLOCKING.getCode().equals(messageTemplate.getTemplateType())) {
XxlJobInfo xxlJobInfo = xxlJobUtils.buildXxlJobInfo(messageTemplate);
cronTaskService.saveCronTask(xxlJobInfo);
cronTaskService.stopCronTask(messageTemplate.getCronTaskId());

@ -9,6 +9,8 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
import java.util.Objects;
/**
* @author 3y
* @date 2022/12/22
@ -47,7 +49,7 @@ public class LoginUtils {
public boolean needLogin() {
try {
WeChatLoginConfig bean = applicationContext.getBean(OfficialAccountParamConstant.WE_CHAT_LOGIN_CONFIG, WeChatLoginConfig.class);
if (CommonConstant.ENV_TEST.equals(env) && bean != null) {
if (CommonConstant.ENV_TEST.equals(env) && Objects.nonNull(bean)) {
return true;
}
} catch (Exception e) {

@ -6,6 +6,7 @@ import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Objects;
/**
@ -35,7 +36,7 @@ public class SpringFileUtils {
} catch (IOException e) {
e.printStackTrace();
} finally {
if (out != null) {
if (Objects.nonNull(out)) {
try {
out.close();
} catch (IOException e) {

Loading…
Cancel
Save