code: private static OwnerAndPermission addExecutePermissionsIfRequired(FileStatus file,
        OwnerAndPermission ownerAndPermission) {
  
      if (ownerAndPermission.getFsPermission() == null) {
        return ownerAndPermission;
      }
  
      if (!file.isDir()) {
        return ownerAndPermission;
      }
  
      return new OwnerAndPermission(ownerAndPermission.getOwner(), ownerAndPermission.getGroup(),
          addExecutePermissionToOwner(ownerAndPermission.getFsPermission()));
    }
docs: The method makes sure it always grants execute permissions for an owner if the <code>file</code> passed is a
  directory. The publisher needs it to publish it to the final directory and list files under this directory.