Assuming a directory containing multiple files was added, e.g. with ipfs.addAll(globSource(folder...))
each of the contained files will have a CID, and the directory itself will have a CID too.
Q1: Is it possible to get the directory CID, only with knowledge of one of the file CIDs? Q2: How about with knowledge of all contained file CIDs?
Note in reality this could be really really hard (cryptograpically impossible hard), however go-ipfs is predictable and do easy things. However if someone used an other implementation than go-ipfs it might be impossible but 99%+ of people use go-ipfs in the end.
If you know the list of the all the files and their name in the directory, you can use the MFS to recreate the same dir.
(Note this assume your MFS is empty.)
ipfs files cp /ipfs/Qmfoo /0
ipfs files cp /ipfs/Qmbar /1
ipfs files cp /ipfs/Qmbaz /2
# add all the files ...
ipfs files stat / # Use that to get the CID of the dir