This commit refactors the S3DownloadService to utilize the S3 API directly instead of relying on a separate .meta file for object information.
These changes improve the resilience of the S3 download service by-
Preventing unexpected service failures due to null values or missing .meta files.
Ensuring consistent execution flow by handling different scenarios uniformly.
Null Handling: The code now checks if objectSpec is null and handles the case, preventing potential issues encountered earlier.
The code is responsible for using the part size (length) from the S3 API. By fetching object metadata and using it to fill part URLs and create the ObjectSpecification, the code ensures that the sizes and offsets match the actual stored parts on S3, rather than solely relying on user-specified values
Exception Handling: The exception thrown when the .meta file was missing previously caused service failure. This is now caught and handled by returning null instead.
Introduced a try-catch block to handle the IdNotFoundException that occurs when the .meta file is missing. By catching this exception and returning null, the service avoids failure and provides a controlled response, enhancing the overall stability of the application.
Additions to Unit Test Updates in order to validate the new exception handling mechanism. This test case ensures that the service does not fail when the .meta file is missing and that a NullPointerException is appropriately handled.
Overall, this commit modernizes the S3 service by leveraging the S3 API directly.
This commit refactors the S3DownloadService to utilize the S3 API directly instead of relying on a separate .meta file for object information.
These changes improve the resilience of the S3 download service by-
Additions to Unit Test Updates in order to validate the new exception handling mechanism. This test case ensures that the service does not fail when the .meta file is missing and that a NullPointerException is appropriately handled.
Overall, this commit modernizes the S3 service by leveraging the S3 API directly.