code: static void backupDirectory(final File source, final File target) throws IOException {
          if (!target.exists()) {
              if (!target.mkdirs()) {
                  throw PatchLogger.ROOT_LOGGER.cannotCreateDirectory(target.getAbsolutePath());
              }
          }
          final File[] files = source.listFiles(CONFIG_FILTER);
          for (final File file : files) {
              final File t = new File(target, file.getName());
              IoUtils.copyFile(file, t);
          }
      }
docs: Backup all xml files in a given directory.
  
  @param source the source directory
  @param target the target directory
  @throws IOException for any error