diff --git a/.agent/consumer.md b/.agent/consumer.md index 1811aab..50fbfea 100644 --- a/.agent/consumer.md +++ b/.agent/consumer.md @@ -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 diff --git a/AGENTS.md b/AGENTS.md index 98f89c3..172467d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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 diff --git a/README.md b/README.md index 49e60e7..a12b9d3 100644 --- a/README.md +++ b/README.md @@ -486,6 +486,8 @@ Apache POI 기반 Excel 읽기/쓰기 helper입니다. - SAX 기반 대용량 스트리밍 읽기 - streaming writer를 열어 row를 점진적으로 append +`Path`를 받는 `readStreaming`과 `readHeaderStreaming`은 `PackageAccess.READ`로 파일을 열어 원본의 SHA-256, 크기, 수정 시각을 유지합니다. 읽기 전용 파일도 처리하며, 콜백에서 예외가 발생해도 원본을 저장하지 않고 파일 핸들을 해제합니다. 기존 옵션 검증, 예외 처리, SAX 스트리밍 방식은 유지합니다. + #### `StreamingReadOptions` 스트리밍 읽기 옵션입니다. diff --git a/build.gradle b/build.gradle index fe71fed..fc0076f 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ plugins { } // 버전 변경은 여기서 -def commonVer = "beta.1.6.9" +def commonVer = "beta.1.7.0" group = 'com.kri.common' version = commonVer diff --git a/src/main/java/com/kri/common/feature/excel/ExcelMapper.java b/src/main/java/com/kri/common/feature/excel/ExcelMapper.java index 147d4a0..287b37a 100644 --- a/src/main/java/com/kri/common/feature/excel/ExcelMapper.java +++ b/src/main/java/com/kri/common/feature/excel/ExcelMapper.java @@ -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 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);