title: Spark streaming - textFileStream/fileStream - Get file name
body: <p>Using spark streaming I am watching for the files in HDFS using <code>textFileStream/fileStream</code> methods, how do we get the <code>fileNames</code> which are read by these methods? </p>
  
  <p>I used <code>textFileStream</code> which has file contents in <code>JavaDStream</code> and I got no success with <code>fileStream</code> as it is throwing me a compilation error with spark version 1.3.1. </p>
  
  <p>Can someone please tell me if we have an API function or any other way to get the file names that these streaming methods read? </p>
  
  <p>Thanks 
  Lokesh</p>