a few ameliorations. File and folder are inherited from repository.
if there is no share, it goes search the nearest share.