clebertsuconic commented on code in PR #4615:
URL: https://github.com/apache/activemq-artemis/pull/4615#discussion_r1327437254


##########
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/FileUtil.java:
##########
@@ -72,4 +82,27 @@ public static final boolean deleteDirectory(final File 
directory) {
       return directory.delete();
    }
 
+   public static final void copyDirectory(final File directorySource, final 
File directoryTarget) throws Exception {
+      Path sourcePath = directorySource.toPath();
+      Path targetPath = directoryTarget.toPath();
+
+      try {
+         Files.walkFileTree(sourcePath, new SimpleFileVisitor<>() {
+            @Override
+            public FileVisitResult preVisitDirectory(Path dir, 
BasicFileAttributes attrs) throws IOException {
+               Path targetDir = targetPath.resolve(sourcePath.relativize(dir));
+               Files.createDirectories(targetDir);
+               return FileVisitResult.CONTINUE;
+            }
+
+            @Override
+            public FileVisitResult visitFile(Path file, BasicFileAttributes 
attrs) throws IOException {
+               Files.copy(file, 
targetPath.resolve(sourcePath.relativize(file)), 
StandardCopyOption.REPLACE_EXISTING);
+               return FileVisitResult.CONTINUE;
+            }
+         });
+      } catch (IOException e) {
+         e.printStackTrace();
+      }

Review Comment:
   Yes.... it should be taken out



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