This was actually a review comment from Ryota Egashira to also explicitly check for port number existence, else there is no need to convert URI to its path component. The intention of the fix that originally broke oozie-4 (OOZIE-1381) was to support adding file from a different NN host:port into dist cache. See https://reviews.apache.org/r/17371/