title: How to move files within the Hadoop HDFS directory?
body: <p>I need to move the files from one HDFS directory to another HDFS directory.</p>
  
  <p>I wanted to check if there's some easier way (some HDFS API) to achieve the same task, other than InputStream/OutputStream ?</p>
  
  <p>I've heard of <code>FileSystem.rename(srcDir, destDir);</code> but is unsure if this will delete the original src directory.</p>
  
  <p>I don't want to remove the original directory structure, only move the files from one folder to another directory.</p>
  
  <p>e.g</p>
  
  <pre><code>input Dir - /testHDFS/input/*.txt
  dest Dir - /testHDFS/destination
  </code></pre>
  
  <p>After moving the files, directory should look something like this :-</p>
  
  <pre><code>input Dir - /testHDFS/input
  dest Dir - /testHDFS/destination/*.txt
  </code></pre>
  
  <p>PS : I want to achieve this working inside mapper function for each file.</p>
  
  <p>Any help would be appreciated.</p>