cstamas commented on a change in pull request #6:
URL: https://github.com/apache/maven-clean-plugin/pull/6#discussion_r770917547



##########
File path: src/main/java/org/apache/maven/plugins/clean/Cleaner.java
##########
@@ -115,9 +124,63 @@ public void delete( File basedir, Selector selector, 
boolean followSymlinks, boo
 
         File file = followSymlinks ? basedir : basedir.getCanonicalFile();
 
+        if ( selector == null && !followSymlinks && fastFolder != null )
+        {
+            if ( fastDelete( file ) )
+            {
+                return;
+            }
+        }
+
         delete( file, "", selector, followSymlinks, failOnError, retryOnError 
);
     }
 
+    private boolean fastDelete( File baseDir )
+    {
+        fastFolder.mkdirs();
+        if ( fastFolder.isDirectory() )
+        {
+            try
+            {
+                File tmpDir = createTempDir( fastFolder );
+                File dstDir = new File( tmpDir, baseDir.getName() );
+                Files.move( baseDir.toPath(), dstDir.toPath(), 
StandardCopyOption.ATOMIC_MOVE );

Review comment:
       Slightly unrelated, but still related: I think it is _sane_ to expect 
(maybe define as requirement some where) that local repository MUST BE on same 
mount. Same thing here, I think it is IMHO OKAY to _assume_ that target fol... 
sorry, directory is on same mount. (more about why's later)




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