public static long directorySize ( File self ) throws IOException , IllegalArgumentException { final long [ ] size = { 0L } ; eachFileRecurse ( self , FileType . FILES , new Closure < Void > ( null ) { public void doCall ( Object [ ] args ) { size [ 0 ] += ( ( File ) args [ 0 ] ) . length ( ) ; } } ) ; return size [ 0 ] ; }
Calculates directory size as total size of all its files recursively .