garydgregory commented on a change in pull request #31: DirectoryUtils - 
isEqual to compare directories
URL: https://github.com/apache/commons-io/pull/31#discussion_r350243597
 
 

 ##########
 File path: src/main/java/org/apache/commons/io/DirectoryUtils.java
 ##########
 @@ -0,0 +1,149 @@
+package org.apache.commons.io;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.DirectoryStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+
+/**
+ * General directory manipulation utilities.
+ * <p>
+ * Facilities are provided in the following areas:
+ * <ul>
+ * <li>comparing directories
+ * </ul>
+ * <p>
+ * 
+ * Original code: 
http://stackoverflow.com/questions/14522239/test-two-directory-trees-for-equality
+ *
+ */
+public class DirectoryUtils {
+
+    /**
+     * checks if the directory file lists are equal.
+     * 
+     * If checkFileContent is true, then also if the file content is equal
+     * 
+     * @param directory
+     *            the directory
+     * @param compareDirectory
+     *            the directory to compare with
+     * @param checkFileContent
+     *            also compare file content
+     * @return true if directory and compareDirectory are equal
+     * @throws IOException
+     */
+    public static boolean isEqual(Path directory, Path compareDirectory, 
boolean checkFileContent)
 
 Review comment:
   TL;DR: Use `final` where possible; IMO 
https://garygregory.wordpress.com/2013/01/26/the-final-kiss-in-java/

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to