GeorgeJahad commented on code in PR #3746:
URL: https://github.com/apache/ozone/pull/3746#discussion_r979139835
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/handlers/DirectoryEntityHandler.java:
##########
@@ -89,7 +91,15 @@ public DUResponse getDuResponse(
for (long subdirObjectId: subdirs) {
NSSummary subdirNSSummary =
getReconNamespaceSummaryManager().getNSSummary(subdirObjectId);
- String subdirName = subdirNSSummary.getDirName();
+ // for the subdirName we need the filename, not the key name
+ Path subdirPath = Paths.get(subdirNSSummary.getDirName());
+ Path subdirFileName = subdirPath.getFileName();
+ String subdirName;
+ if (subdirFileName != null) {
+ subdirName = subdirFileName.toString();
+ } else {
+ throw new NullPointerException("Subdirectory file name is null.");
+ }
Review Comment:
is this change to remove the trailing slash? why not:
OzoneFSUtils.removeTrailingSlashIfNeeded()
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]