cstamas commented on code in PR #10:
URL: 
https://github.com/apache/maven-build-cache-extension/pull/10#discussion_r868869048


##########
src/main/java/org/apache/maven/buildcache/RemoteCacheRepositoryImpl.java:
##########
@@ -147,50 +157,33 @@ public void saveArtifactFile( CacheResult cacheResult,
     @Nonnull
     public Optional<byte[]> getResourceContent( String url ) throws IOException
     {
-        HttpGet get = new HttpGet( url );
         try
         {
             LOGGER.info( "Downloading {}", url );
-            HttpResponse response = httpClient.get().execute( get );
-            int statusCode = response.getStatusLine().getStatusCode();
-            if ( statusCode != HttpStatus.SC_OK )
-            {
-                LOGGER.info( "Cannot download {}, status code: {}", url, 
statusCode );
-                return Optional.empty();
-            }
-            try ( InputStream content = response.getEntity().getContent() )
-            {
-                return Optional.of( IOUtils.toByteArray( content ) );
-            }
+            GetTask task = new GetTask( new URI( url ) );
+            transporter.get( task );
+            return Optional.of( task.getDataBytes() );

Review Comment:
   Word of warning: unsure the data size here, but if not "heap friendly" 
sized, this is OOM prone



-- 
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