How do I get root dependency files from configuration?

configurations.moduled.files return all files in dependency graph, but i just want to get the root dependency files, how can i do?