title: Get files name in directory
body: <p>I'm using this code to get all files in directory. But with this code I get file name and directory path. Can you help me to fix the code only to return List of Files names without file path.</p>
  
  <pre><code>public List&lt;String&gt; getAllDirFiles() {
      List&lt;String&gt; fileNames = new ArrayList&lt;&gt;();
      try (DirectoryStream&lt;Path&gt; directoryStream
              = Files.newDirectoryStream(Paths.get("repository"))) {
          for (Path path : directoryStream) {
              fileNames.add(path.toString());
          }
      } catch (IOException ex) {}
      return fileNames;
  }
  </code></pre>