Use the not deprecated method for contents of directory