spotlessApply 적용

This commit is contained in:
2025-12-03 18:48:13 +09:00
parent 7884416e75
commit 767a11559f
4 changed files with 20 additions and 27 deletions

View File

@@ -1,10 +1,9 @@
package com.kamco.cd.kamcoback.common.utils; package com.kamco.cd.kamcoback.common.utils;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
public class NameValidator { public class NameValidator {
private static final String HANGUL_REGEX = ".*\\p{IsHangul}.*"; private static final String HANGUL_REGEX = ".*\\p{IsHangul}.*";
private static final Pattern HANGUL_PATTERN = Pattern.compile(HANGUL_REGEX); private static final Pattern HANGUL_PATTERN = Pattern.compile(HANGUL_REGEX);
@@ -12,7 +11,6 @@ public class NameValidator {
private static final String WHITESPACE_REGEX = ".*\\s.*"; private static final String WHITESPACE_REGEX = ".*\\s.*";
private static final Pattern WHITESPACE_PATTERN = Pattern.compile(WHITESPACE_REGEX); private static final Pattern WHITESPACE_PATTERN = Pattern.compile(WHITESPACE_REGEX);
public static boolean containsKorean(String str) { public static boolean containsKorean(String str) {
if (str == null || str.isEmpty()) { if (str == null || str.isEmpty()) {
return false; return false;
@@ -21,7 +19,6 @@ public class NameValidator {
return matcher.matches(); return matcher.matches();
} }
public static boolean containsWhitespaceRegex(String str) { public static boolean containsWhitespaceRegex(String str) {
if (str == null || str.isEmpty()) { if (str == null || str.isEmpty()) {
return false; return false;
@@ -43,6 +40,4 @@ public class NameValidator {
return false; return false;
} }
} }

View File

@@ -3,7 +3,6 @@ package com.kamco.cd.kamcoback.mapsheet;
import com.kamco.cd.kamcoback.code.dto.CommonCodeDto; import com.kamco.cd.kamcoback.code.dto.CommonCodeDto;
import com.kamco.cd.kamcoback.code.service.CommonCodeService; import com.kamco.cd.kamcoback.code.service.CommonCodeService;
import com.kamco.cd.kamcoback.config.api.ApiResponseDto; import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto;
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.FilesDto; import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.FilesDto;
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.FoldersDto; import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.FoldersDto;
import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.SrchFilesDto; import com.kamco.cd.kamcoback.mapsheet.dto.FileDto.SrchFilesDto;

View File

@@ -43,14 +43,14 @@ public class FileDto {
private final Boolean isValid; private final Boolean isValid;
public FolderDto( public FolderDto(
String folderNm, String folderNm,
String parentFolderNm, String parentFolderNm,
String parentPath, String parentPath,
String fullPath, String fullPath,
int depth, int depth,
long childCnt, long childCnt,
String lastModified, String lastModified,
Boolean isValid) { Boolean isValid) {
this.folderNm = folderNm; this.folderNm = folderNm;
this.parentFolderNm = parentFolderNm; this.parentFolderNm = parentFolderNm;
this.parentPath = parentPath; this.parentPath = parentPath;
@@ -70,7 +70,8 @@ public class FileDto {
private final int folderErrTotCnt; private final int folderErrTotCnt;
private final List<FolderDto> folders; private final List<FolderDto> folders;
public FoldersDto(String dirPath, int folderTotCnt, int folderErrTotCnt, List<FolderDto> folders) { public FoldersDto(
String dirPath, int folderTotCnt, int folderErrTotCnt, List<FolderDto> folders) {
this.dirPath = dirPath; this.dirPath = dirPath;
this.folderTotCnt = folderTotCnt; this.folderTotCnt = folderTotCnt;
@@ -79,8 +80,6 @@ public class FileDto {
} }
} }
@Schema(name = "File Basic", description = "파일 기본 정보") @Schema(name = "File Basic", description = "파일 기본 정보")
@Getter @Getter
public static class Basic { public static class Basic {
@@ -92,7 +91,7 @@ public class FileDto {
private final String lastModified; private final String lastModified;
public Basic( public Basic(
String fileNm, String filePath, String extension, long fileSize, String lastModified) { String fileNm, String filePath, String extension, long fileSize, String lastModified) {
this.fileNm = fileNm; this.fileNm = fileNm;
this.filePath = filePath; this.filePath = filePath;
this.extension = extension; this.extension = extension;

View File

@@ -37,7 +37,6 @@ public class MapSheetMngService {
private final MapSheetMngCoreService mapSheetMngCoreService; private final MapSheetMngCoreService mapSheetMngCoreService;
public FoldersDto getFolderAll(SrchFoldersDto srchDto) { public FoldersDto getFolderAll(SrchFoldersDto srchDto) {
Path startPath = Paths.get(srchDto.getDirPath()); Path startPath = Paths.get(srchDto.getDirPath());
@@ -68,8 +67,8 @@ public class MapSheetMngService {
String fullPath = path.toAbsolutePath().toString(); String fullPath = path.toAbsolutePath().toString();
boolean isValid = true; boolean isValid = true;
if( NameValidator.containsKorean(folderNm) || if (NameValidator.containsKorean(folderNm)
NameValidator.containsWhitespaceRegex(folderNm) ){ || NameValidator.containsWhitespaceRegex(folderNm)) {
isValid = false; isValid = false;
} }
@@ -99,8 +98,7 @@ public class MapSheetMngService {
depth, depth,
childCnt, childCnt,
lastModified, lastModified,
isValid isValid);
);
return folderDto; return folderDto;
}) })
@@ -114,9 +112,11 @@ public class MapSheetMngService {
folderTotCnt = folderDtoList.size(); folderTotCnt = folderDtoList.size();
folderErrTotCnt = (int)folderDtoList.stream() folderErrTotCnt =
.filter(dto -> dto.getIsValid().toString().equals("false") ) (int)
.count(); folderDtoList.stream()
.filter(dto -> dto.getIsValid().toString().equals("false"))
.count();
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);