Implement listDirectory