You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2018/05/03 23:04:05 UTC

[GitHub] emilianbold commented on a change in pull request #504: Skip CoS copying of class files when the target is already newer, such as from an external compilation

emilianbold commented on a change in pull request #504: Skip CoS copying of class files when the target is already newer, such as from an external compilation
URL: https://github.com/apache/incubator-netbeans/pull/504#discussion_r185959081
 
 

 ##########
 File path: java.source.base/src/org/netbeans/modules/java/source/usages/BuildArtifactMapperImpl.java
 ##########
 @@ -302,30 +313,31 @@ private static void copyFile(FileObject updatedFile, File target) throws IOExcep
         }
     }
 
-    private static void copyRecursively(File source, File target) throws IOException {
-        if (source.isDirectory()) {
-            if (target.exists() && !target.isDirectory()) {
-                throw new IOException("Cannot create folder: " + target.getAbsolutePath() + ", already exists as a file.");
-            }
+    private static void copyRecursively(File source, File target, URL sourceURL) throws IOException {
+        if (target.exists() && !target.isDirectory()) {
+            throw new IOException("Cannot create folder: " + target.getAbsolutePath() + ", already exists as a file.");
+        }
 
-            File[] listed = source.listFiles();
-            
-            if (listed == null) {
-                return ;
-            }
-            
-            for (File f : listed) {
-                String name = f.getName();
-                if (name.endsWith(SIG))
-                    name = name.substring(0, name.length() - FileObjects.SIG.length()) + FileObjects.CLASS;
-                copyRecursively(f, new File(target, name));
-            }
-        } else {
-            if (target.isDirectory()) {
-                throw new IOException("Cannot create file: " + target.getAbsolutePath() + ", already exists as a folder.");
-            }
+        File[] listed = source.listFiles();
 
-            copyFile(source, target);
+        if (listed == null) {
+            return ;
+        }
+
+        for (File f : listed) {
+            String name = f.getName();
+            if (name.endsWith(SIG))
+                name = name.substring(0, name.length() - FileObjects.SIG.length()) + FileObjects.CLASS;
 
 Review comment:
   You are already doing something with .sig here...

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists