sonarqube plugin add && 보안점검 소스 수정(portal-service)

This commit is contained in:
shinmj
2021-11-18 10:46:23 +09:00
parent 2b7177659d
commit bc24c9f706
7 changed files with 27 additions and 8 deletions

View File

@@ -132,14 +132,18 @@ public class BannerService extends AbstractService {
Banner entity = bannerRepository.save(requestDto.toEntity(site));
//첨부파일 entity 정보 업데이트 하기 위해 이벤트 메세지 발행
sendAttachment(entity);
return new BannerResponseDto(entity);
}
public void sendAttachment(Banner entity) {
sendAttachmentEntityInfo(streamBridge,
AttachmentEntityMessage.builder()
.attachmentCode(entity.getAttachmentCode())
.entityName(entity.getClass().getName())
.entityId(String.valueOf(entity.getBannerNo()))
.build());
return new BannerResponseDto(entity);
}
/**

View File

@@ -88,7 +88,9 @@ public class MenuRoleService extends AbstractService {
}else {
MenuRole menuRole = menuRoleRepository.findById(menuRoleRequestDto.getMenuRoleId()).orElse(null);
menuRole.setMenu(menu);
if (menuRole != null) {
menuRole.setMenu(menu);
}
}
} else {
//unchecked 인 경우 menurole 삭제

View File

@@ -124,7 +124,7 @@ public class FileStorageUtils implements StorageUtils {
File renameFile = new File(path + "/" + rename);
try {
file.renameTo(renameFile);
} catch (Exception ex) {
} catch (NullPointerException ex) {
// 파일을 찾을 수 없습니다.
throw new BusinessMessageException(messageUtil.getMessage("valid.file.not_found"));
}

View File

@@ -44,7 +44,7 @@ public class FtpClientDto {
public FtpClientDto(Environment env) {
this.ftpClient = new FTPClient();
this.hostname = env.getProperty("ftp.hostname");
this.port = Integer.parseInt(env.getProperty("ftp.port"));
this.port = Integer.parseInt(env.getProperty("ftp.port", ""));
this.username = env.getProperty("ftp.username");
this.password = env.getProperty("ftp.password");
this.directory = env.getProperty("ftp.directory");

View File

@@ -87,7 +87,7 @@ public class FtpStorageUtils implements StorageUtils {
this.disconnect(ftpClient);
}
} catch (Exception ex) {
} catch (IOException ex) {
throw new BusinessException(ErrorCode.INTERNAL_SERVER_ERROR, "Could not create the directory where the uploaded files will be stored.");
}
}
@@ -191,7 +191,7 @@ public class FtpStorageUtils implements StorageUtils {
}
}
} catch (Exception e) {
} catch (IOException e) {
log.error("FTPClient Exception", e);
throw new BusinessMessageException(messageUtil.getMessage("valid.file.not_saved_try_again"));
} finally {
@@ -405,7 +405,7 @@ public class FtpStorageUtils implements StorageUtils {
ftpClient.deleteFile(ftpClientDto.getDirectory() + StringUtils.cleanPath("/" + filename));
this.disconnect(ftpClient);
return true;
} catch (Exception e) {
} catch (IOException e) {
log.error("Could not deleted file.", e);
return false;
}