Make sure when reading cdm folder that a file is a file, not a folder.
Automatically checks all files in the directory for a valid CDM