title: Merge directories - Java
body: <p>I have a directory:</p>
  <pre><code>| content
  | - folderWithTextFile
  | - - textFile.txt
  | - - folderWithPdfFile
  | - - - pdfFile.pdf
  </code></pre>
  <p>... and I want to merge it into another directory of the same name:</p>
  <pre><code>| content
  | - folderWithExeFile
  | - - exeFile.exe
  | - - folderWithPngFile
  | - - - pngFile.png
  </code></pre>
  <p>... so that I have this in the end:</p>
  <pre><code>| content
  | - folderWithTextFile
  | - - textFile.txt
  | - - folderWithPdfFile
  | - - - pdfFile.pdf
  | - folderWithExeFile
  | - - exeFile.exe
  | - - folderWithPngFile
  | - - - pngFile.png
  </code></pre>
  <p>Using <code>Files.move(target, destination, StandardCopyOptions.REPLACE_EXISTING)</code> gives me a <code>DirectoryNotEmptyException</code> as <em>secondFolder</em> is not empty.</p>
  <p>Using Apache Commons IO <code>FileUtils.moveDirectory(target, destination)</code> gives a <code>FileExistsException</code> as the target already exists.</p>
  <p>I would like a way to merge these two structures. It must copy the <em>whole</em> structure, not just one file.</p>