2 Commits

View File

@@ -525,12 +525,13 @@ public class DatasetService {
// 존재 + 디렉토리 체크 // 존재 + 디렉토리 체크
if (!dir.exists() || !dir.isDirectory()) { if (!dir.exists() || !dir.isDirectory()) {
throw new RuntimeException("Invalid path"); throw new CustomApiException("BAD_REQUEST", HttpStatus.BAD_REQUEST, "잘못된 경로입니다.");
} }
// 권한 없을때 // 권한 없을때
if (!dir.canRead()) { if (!dir.canRead()) {
throw new RuntimeException("Permission denied"); throw new CustomApiException(
ApiResponseCode.FORBIDDEN.getId(), HttpStatus.FORBIDDEN, "디렉토리에 접근할 권한이 없습니다.");
} }
String canonicalPath = dir.getCanonicalPath(); String canonicalPath = dir.getCanonicalPath();