You could try this. Sorry, I don't have any data to test it on. It should find each root node and return a list of directories under the root. Each directory will have the nodes along the path and a list of the files within the directory. Let me know if it does not work or needs some tweaking.
match p=(a:Root)-[k:CHILD*]->(r:Directory)
with a, [i in nodes(p) where "CHILD" in labels(i)] as path, r
return a, collect({
directory: r,
path: path,
files: [(r)-[:CHILD]->(l:File) | l]
}) as directories
The query I provided will not show the directories within the directory. You can try this if that is important.
match p=(a:Root)-[k:CHILD*]->(r:Directory)
with a, [i in nodes(p) where "CHILD" in labels(i)] as path, r
return a, collect({
directory: r,
path: path,
subdirectories: [(r)-[:CHILD]->(l:Directory) | l],
files: [(r)-[:CHILD]->(l:File) | l]
}) as directories