code: public static void copy(final File aFromFile, final File aToFile) throws IOException {
          if (aFromFile.isDirectory() && aToFile.isFile() || aFromFile.isFile() && aToFile.isDirectory()) {
              throw new IOException(LOGGER.getI18n(MessageCodes.UTIL_037, aFromFile, aToFile));
          }
  
          if (aFromFile.isDirectory()) {
              if (!aToFile.exists() && !aToFile.mkdirs()) {
                  throw new IOException(LOGGER.getI18n(MessageCodes.UTIL_035, aToFile.getAbsolutePath()));
              }
  
              for (final File file : aFromFile.listFiles()) {
                  copy(file, new File(aToFile, file.getName()));
              }
          } else {
              copyFile(aFromFile, aToFile);
          }
      }
docs: Copies a file or directory from one place to another. This copies a file to a file or a directory to a
  directory. It does not copy a file to a directory.
  
  @param aFromFile A file or directory source
  @param aToFile A file or directory destination
  @throws IOException If there is an exception copying the files or directories