Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new integration test class, ITResumableUpload, to verify the behavior of the generated ResumableUploadServiceClient across various scenarios, including synchronous/asynchronous uploads, multi-chunk uploads, and channel guards. The review feedback suggests a minor improvement to use Files.newInputStream(file) instead of new FileInputStream(file.toFile()) to ensure compatibility with non-default file systems.
| UploadMediaRequest request = | ||
| UploadMediaRequest.newBuilder().setName("it-client-sync.txt").build(); | ||
|
|
||
| try (InputStream stream = new FileInputStream(file.toFile())) { |
There was a problem hiding this comment.
Prefer using Files.newInputStream(file) instead of new FileInputStream(file.toFile()). Calling Path.toFile() can throw an UnsupportedOperationException if the Path is associated with a non-default file system (such as an in-memory file system like Jimfs). Using Files.newInputStream(path) is the idiomatic Java NIO.2 approach and ensures compatibility across different FileSystem implementations. This improvement can be applied to all other occurrences in this file (lines 106, 127, 141, 156, and 185).
| try (InputStream stream = new FileInputStream(file.toFile())) { | |
| try (InputStream stream = Files.newInputStream(file)) { |
bbf4925 to
6f448dc
Compare
102dc19 to
ad3d894
Compare
Work in progress, not ready for review