using a method that's compatible across hadoop versions to list paths