title: How can move file from one directory to another
body: <p>I am sorry,I modified my entire question.</p>
  
  <p>I want to move some specific files(based on <code>fileExtension</code>) from one directory to another.</p>
  
  <p>For this, I plan to write 2 functions names are <code>ListOfFileNames</code> and <code>MovingFiles</code>.</p>
  
  <p>If you pass <code>directorypath</code> and <code>filetype</code> as a arguments to<code>ListOfFileNames()</code>,it returns <code>List&lt;File&gt;</code>data.this list have entire file path.</p>
  
  <p><code>MovingFiles()</code> move files from source Directory to destination.</p>
  
  <p>I tried <code>MovingFiles</code> function, in the following way.It's not working.</p>
  
  <pre><code>public void MovingFiles(String SourcePath,String directoryPath,String fileType) throws IOException
  {
      ExternalFileExecutions ExternalFileExecutionsObject=new ExternalFileExecutions();
      List&lt;File&gt; fileNames=ExternalFileExecutionsObject.ListOfFileNames(SourcePath, fileType);
      for (int fileIndex = 0; fileIndex &lt; fileNames.size(); fileIndex++) 
      {
          fileNames[fileIndex].renameTo(new File(directoryPath+"/" + fileNames[fileIndex].getName()))
      }
  }
  </code></pre>
  
  <p>I think, I need to convert <code>List&lt;File&gt;</code> to <code>List&lt;String&gt;</code>.that's why Previously I asked like that.</p>
  
  <p>@tbodt replyed for my question.I failed to integrate his answer in my function.so I modified my question.</p>
  
  <p>Again sorry, for modifying my entire question.</p>
  
  <p>Thanks.</p>