Merged
Conversation
feat: enhance file handling with storage key management and retrieval…
Release/v0.3.1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors how file content is managed and accessed by replacing the use of "location" with "storageKey" throughout the application. It also updates the
StorageServiceinterface to usestorageKeyfor all operations and introduces streaming support for file content retrieval. Additionally, it improves error handling when storing files and updates related tests accordingly.Core Refactoring: Storage Key Usage
locationin theContentvalue object withstorageKey, updating methods, validation, and usages across the application and domain layers. (Content.java,DefaultCreateFileUseCase.java,DefaultDeleteFileUseCase.java, related test files) [1] [2] [3] [4] [5]File Content Retrieval and Streaming
GetFileContentOutputto return anInputStreaminstead of a file location, and updated the use case to retrieve file content as a stream fromStorageService. (GetFileContentOutput.java,DefaultGetFileContentUseCase.java, test updates) [1] [2] [3] [4] [5] [6]Storage Service Interface and Error Handling
StorageServiceinterface to usestorageKeyfor storing, retrieving, and deleting files, and to support streaming with anInputStream. Introduced theStorageKeyAlreadyExistsExceptionfor handling duplicate keys during storage. (StorageService.java,StorageKeyAlreadyExistsException.java,DefaultCreateFileUseCase.java) [1] [2] [3]StorageKeyAlreadyExistsException.Test Updates
storageKeyinstead oflocation, to mock the new streaming and storage behaviors, and to verify correct interactions with the updatedStorageServiceinterface. (DefaultCreateFileUseCaseTest.java,DefaultGetFileContentUseCaseTest.java,DefaultDeleteFileUseCaseTest.java,FileTest.java) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]API/Controller Layer
InputStreamResourceinstead ofFileSystemResourcefor serving file content, matching the new streaming approach. (FileController.java)