public static long getSize ( final File aFile ) { long size = 0 ; if ( aFile != null && aFile . exists ( ) ) { if ( aFile . isDirectory ( ) ) { for ( final File file : aFile . listFiles ( ) ) { size += getSize ( file ) ; } } else { size += aFile . length ( ) ; } } return size ; }
Gets the calculated size of a directory of files .