public static void copyFiles ( File src , File dest ) throws IOException { if ( src . isDirectory ( ) ) { dest . mkdirs ( ) ; String list [ ] = src . list ( ) ; for ( String fileName : list ) { String dest1 = dest . getPath ( ) + "/" + fileName ; String src1 = src . getPath ( ) + "/" + fileName ; // i.e: avoid .svn directory File src1_ = new File ( src1 ) ; File dest1_ = new File ( dest1 ) ; if ( ! src1_ . isHidden ( ) ) { copyFiles ( src1_ , dest1_ ) ; } } } else { FileInputStream fin = new FileInputStream ( src ) ; FileOutputStream fout = new FileOutputStream ( dest ) ; int c ; while ( ( c = fin . read ( ) ) >= 0 ) { fout . write ( c ) ; } fin . close ( ) ; fout . close ( ) ; } }
The method copyFiles being defined