private static void _moveDirectory ( final File srcDest , File destDir ) throws IOException { if ( destDir . exists ( ) ) { checkIsDirectory ( destDir ) ; destDir = file ( destDir , destDir . getName ( ) ) ; destDir . mkdir ( ) ; } final boolean rename = srcDest . renameTo ( destDir ) ; if ( ! rename ) { _copyDirectory ( srcDest , destDir ) ; deleteDir ( srcDest ) ; } }
Moves a directory .