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 ) ; } }
Backup all xml files in a given directory .