We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f29497e commit 49e41f8Copy full SHA for 49e41f8
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java
@@ -604,18 +604,12 @@ public static long getDU(File dir) {
604
return dir.length();
605
} else {
606
File[] allFiles = dir.listFiles();
607
- if(allFiles != null) {
608
- for (int i = 0; i < allFiles.length; i++) {
609
- boolean isSymLink;
610
- try {
611
- isSymLink = org.apache.commons.io.FileUtils.isSymlink(allFiles[i]);
612
- } catch(IOException ioe) {
613
- isSymLink = true;
614
- }
615
- if(!isSymLink) {
616
- size += getDU(allFiles[i]);
617
618
+ if (allFiles != null) {
+ for (File f : allFiles) {
+ if (!org.apache.commons.io.FileUtils.isSymlink(f)) {
+ size += getDU(f);
+ }
619
}
620
return size;
621
0 commit comments