HADOOP-17972. Backport HADOOP-17683 for branch-3.2 (#3573)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Akira Ajisaka <aajisaka@apache.org>
This commit is contained in:
Ananya Singh 2021-10-28 08:16:12 +05:30 committed by GitHub
parent c36d8a1395
commit df9c07fc04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 13 deletions

View File

@ -600,18 +600,12 @@ public class FileUtil {
return dir.length();
} else {
File[] allFiles = dir.listFiles();
if(allFiles != null) {
for (int i = 0; i < allFiles.length; i++) {
boolean isSymLink;
try {
isSymLink = org.apache.commons.io.FileUtils.isSymlink(allFiles[i]);
} catch(IOException ioe) {
isSymLink = true;
}
if(!isSymLink) {
size += getDU(allFiles[i]);
}
}
if (allFiles != null) {
for (File f : allFiles) {
if (!org.apache.commons.io.FileUtils.isSymlink(f)) {
size += getDU(f);
}
}
}
return size;
}

View File

@ -110,7 +110,7 @@
<commons-collections.version>3.2.2</commons-collections.version>
<commons-compress.version>1.21</commons-compress.version>
<commons-csv.version>1.0</commons-csv.version>
<commons-io.version>2.5</commons-io.version>
<commons-io.version>2.8.0</commons-io.version>
<commons-lang3.version>3.7</commons-lang3.version>
<commons-logging.version>1.1.3</commons-logging.version>
<commons-logging-api.version>1.1</commons-logging-api.version>