261016_01_ENH: ExcelRead에 읽기 전용으로 열기 추가

This commit is contained in:
2026-10-16 10:01:20 +09:00
parent 7cd170fe6e
commit 59a4281cea
5 changed files with 8 additions and 3 deletions

View File

@@ -6,6 +6,7 @@
- For HTTP/2 header safety and original upstream error propagation, use the shared HTTP/bypass features documented in the routed platform-capabilities reference instead of implementing consumer-local header filters and raw-response exception handlers.
- Response customizers may call `requireSuccess()`; its upstream exception propagates unchanged. Response charset parsing ignores charset-like text inside other quoted header parameters.
- When Swagger auto-configuration is active, `RequestUserContext` controller arguments are excluded from request input documentation; server-side authentication and client IP injection remain unchanged.
- ExcelMapper's Path-based readStreaming and readHeaderStreaming use PackageAccess.READ, preserving source bytes, size, and modification time, including repeated reads and callback failures. Read-only files are supported, and file handles are released on success or failure; option validation, exception handling, and SAX streaming remain unchanged.
- Do not modify KriCommon or another consumer repository unless it is explicitly included in the approved task scope.
### Required Shared References

View File

@@ -235,6 +235,7 @@ When implementation is complete, report in Korean:
- For HTTP/2 header safety and original upstream error propagation, use the shared HTTP/bypass features documented in the routed platform-capabilities reference instead of implementing consumer-local header filters and raw-response exception handlers.
- Response customizers may call `requireSuccess()`; its upstream exception propagates unchanged. Response charset parsing ignores charset-like text inside other quoted header parameters.
- When Swagger auto-configuration is active, `RequestUserContext` controller arguments are excluded from request input documentation; server-side authentication and client IP injection remain unchanged.
- ExcelMapper's Path-based readStreaming and readHeaderStreaming use PackageAccess.READ, preserving source bytes, size, and modification time, including repeated reads and callback failures. Read-only files are supported, and file handles are released on success or failure; option validation, exception handling, and SAX streaming remain unchanged.
- Do not modify KriCommon or another consumer repository unless it is explicitly included in the approved task scope.
### Required Shared References

View File

@@ -486,6 +486,8 @@ Apache POI 기반 Excel 읽기/쓰기 helper입니다.
- SAX 기반 대용량 스트리밍 읽기
- streaming writer를 열어 row를 점진적으로 append
`Path`를 받는 `readStreaming`과 `readHeaderStreaming`은 `PackageAccess.READ`로 파일을 열어 원본의 SHA-256, 크기, 수정 시각을 유지합니다. 읽기 전용 파일도 처리하며, 콜백에서 예외가 발생해도 원본을 저장하지 않고 파일 핸들을 해제합니다. 기존 옵션 검증, 예외 처리, SAX 스트리밍 방식은 유지합니다.
#### `StreamingReadOptions`
스트리밍 읽기 옵션입니다.

View File

@@ -4,7 +4,7 @@ plugins {
}
// 버전 변경은 여기서
def commonVer = "beta.1.6.9"
def commonVer = "beta.1.7.0"
group = 'com.kri.common'
version = commonVer

View File

@@ -19,6 +19,7 @@ import java.util.Objects;
import java.util.Set;
import java.util.function.UnaryOperator;
import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.openxml4j.opc.PackageAccess;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.DataFormatter;
import org.apache.poi.ss.usermodel.FormulaEvaluator;
@@ -651,7 +652,7 @@ public final class ExcelMapper {
) {
StreamingReadOptions validatedOptions = validateStreamingReadOptions(options);
try (OPCPackage pkg = OPCPackage.open(path.toFile())) {
try (OPCPackage pkg = OPCPackage.open(path.toFile(), PackageAccess.READ)) {
readStreaming(pkg, validatedOptions, handler);
} catch (Exception e) {
throw new RuntimeException("Streaming 엑셀 읽기 중 오류", e);
@@ -746,7 +747,7 @@ public final class ExcelMapper {
public static List<String> readHeaderStreaming(Path path, StreamingReadOptions options) {
StreamingReadOptions validatedOptions = validateStreamingReadOptions(options);
try (OPCPackage pkg = OPCPackage.open(path.toFile())) {
try (OPCPackage pkg = OPCPackage.open(path.toFile(), PackageAccess.READ)) {
return readHeaderStreaming(pkg, validatedOptions);
} catch (Exception e) {
throw new RuntimeException("Streaming 엑셀 헤더 읽기 중 오류", e);