yhs0092 commented on code in PR #4837:
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/4837#discussion_r2137016160


##########
foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/http/FileUploadPart.java:
##########
@@ -36,7 +36,10 @@ public FileUploadPart(FileUpload fileUpload) {
 
   @Override
   public InputStream getInputStream() throws IOException {
-    return Files.newInputStream(new 
File(fileUpload.uploadedFileName()).toPath());
+    final InputStream inputStream = Files.newInputStream(new 
File(fileUpload.uploadedFileName()).toPath());
+    final InputStreamWrapper inputStreamWrapper = new 
InputStreamWrapper(inputStream);
+    
FileUploadStreamRecorder.getInstance().recordOpenStream(inputStreamWrapper);

Review Comment:
   How about moving this line into the constructor of `InputStreamWrapper`?
   It's not about functionality, but since the `clearRecorder` method is 
invoked in the `InputStreamWrapper.close()` method, maybe it's better to move 
the `recordOpenStream` method invocation into the `InputStreamWrapper`, too, so 
that the `FileUploadStreamRecord` can be encapsulated better.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to