code: public static void recursiveCopy(File original, File destDir) throws IOException {
          final String name = original.getName();
          final File destFile = new File(destDir, name);
          if (original.isDirectory()) {
              destFile.mkdir();
              for (File file : original.listFiles()) {
                  recursiveCopy(file, destFile);
              }
          } else {
              final OutputStream os = new FileOutputStream(destFile);
              try {
                  final InputStream is = new FileInputStream(original);
                  copyStreamAndClose(is, os);
              } finally {
                  // in case the input stream open fails
                  safeClose(os);
              }
          }
      }
docs: Recursively copy a file or directory from one location to another.
  
  @param original the original file or directory
  @param destDir  the destination directory
  @throws IOException if an I/O error occurs before the copy is complete