title: create list of String from file names in provided directory
body: <p>probably my question is rather obvious. Would like to look on the one directory and createthe the List of the String, where each string represents the file name stored in given direcotry, e.g. List("file1.csv", "file2.csv", "file3.csv").</p>
  
  <p>I use the function which creates list, but it's list of Files (not Strings) and includes full paths (not only the file names).</p>
  
  <pre><code>import java.io.File
  
  def getFileNames(path: String): List[File] = {
    val d = new File(path)
    if (d.exists &amp;&amp; d.isDirectory) {
      d
        .listFiles // create list of File
        .filter(_.isFile)
        .toList
        .sortBy(_.getAbsolutePath().replaceAll("[^a-zA-Z0-9]",""))
    } else {
      Nil // return empty list
    }
  }
  </code></pre>
  
  <p>Thank you for all the ideas.</p>