You can use REST to get contents / details of data on hdfs.
This will return a JSON:
curl -s "http://node1/webhdfs/v1/user/root?op=LISTSTATUS"