michael-o commented on code in PR #212:
URL: https://github.com/apache/maven-resolver/pull/212#discussion_r1011588336
##########
maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/HttpTransporter.java:
##########
@@ -592,16 +594,25 @@ public void handle( HttpResponse response )
if ( offset < 0L || offset >= length || ( offset > 0L &&
offset != task.getResumeOffset() ) )
{
throw new IOException( "Invalid Content-Range header for
partial download from offset "
- + task.getResumeOffset() + ": " + range );
+ + task.getResumeOffset() + ": " + range );
}
}
- InputStream is = entity.getContent();
- utilGet( task, is, true, length, offset > 0L );
- extractChecksums( response );
+ try ( FileUtils.TempFile tempFile = FileUtils.newTempFile() )
+ {
+ try ( InputStream is = entity.getContent() )
+ {
+ Files.copy( is, tempFile.getPath(),
StandardCopyOption.REPLACE_EXISTING );
+ }
+ try ( InputStream is = Files.newInputStream(
tempFile.getPath() ) )
+ {
Review Comment:
Note that you would rather use
https://www.javadoc.io/doc/org.apache.httpcomponents/httpcore/4.4.4/org/apache/http/HttpEntity.html#writeTo(java.io.OutputStream)..
--
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]