judby commented on a change in pull request #2: Implement MRRESOURCES-102
URL: 
https://github.com/apache/maven-remote-resources-plugin/pull/2#discussion_r235259046
 
 

 ##########
 File path: 
src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java
 ##########
 @@ -1336,6 +1341,41 @@ else if ( appendedVmResourceFile.exists() )
         }
     }
 
+    private void copyBundleResource( ClassLoader classLoader, String 
bundleResource, File to )
+        throws IOException
+    {
+        URL resUrl = classLoader.getResource( bundleResource );
+        if ( resUrl != null )
+        {
+            FileUtils.copyURLToFile( resUrl, to );
+        }
+    }
+
+    private void filterBundleResource( ClassLoader classLoader, String 
bundleResource, File to )
+        throws IOException, MojoExecutionException
+    {
+        File tmpFile = null;
+        try
+        {
+            tmpFile = File.createTempFile( "maven-remote-resources-plugin", 
null );
+            tmpFile.deleteOnExit();
 
 Review comment:
   Consider moving `deleteOnExit()` to the finally block, where the file will 
either be deleted at once, or a warning will be written.
   `deleteOnExit()` adds the `Path` to a list of files to delete on exit and 
does not scale well if there are many files.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to