Add validation of folder name.
Merge pull request #884 from ForNeVeR/dirname-validate

Folder name validation