Check if there is an empty data directory before creating manifest files

Checks using existing empty? method if there is a directory before creating the manifest files. Rspec test added also.