code: private void copyDirectoryStructureIfModified(File sourceDir, File destDir)
              throws IOException {
          
          DirectoryScanner scanner = new DirectoryScanner();
          scanner.setBasedir( sourceDir );
          scanner.addDefaultExcludes();
          scanner.scan();
  
          /*
           * NOTE: Make sure the destination directory is always there (even if empty) to support POM-less ITs.
           */
          destDir.mkdirs();
          String[] includedDirs = scanner.getIncludedDirectories();
          for ( int i = 0; i < includedDirs.length; ++i ) {
              File clonedDir = new File( destDir, includedDirs[i] );
              clonedDir.mkdirs();
          }
  
          String[] includedFiles = scanner.getIncludedFiles();
          for ( int i = 0; i < includedFiles.length; ++i ) {
              File sourceFile = new File(sourceDir, includedFiles[i]);
              File destFile = new File(destDir, includedFiles[i]);
              FileUtils.copyFileIfModified(sourceFile, destFile);
          }
      }
docs: Copied a directory structure with deafault exclusions (.svn, CVS, etc)
  
  @param sourceDir The source directory to copy, must not be <code>null</code>.
  @param destDir The target directory to copy to, must not be <code>null</code>.
  @throws java.io.IOException If the directory structure could not be copied.