Updating code to run in both CHD3/4 and Hortonworks current releases

hadoop fs -ls -d is not compatible with releases other than CDH4. This update should work in all versions.
Updating code to run in both CHD3/4 and Hortonworks current releases

Updated code after the review
Merge pull request #121 from vivshri/master

Fixing file existence check to make it compatible with various hadoop releases and distributions