public static BigInteger sizeOfDirectoryAsBigInteger(File directory){
  checkDirectory(directory);
  final File[] files=directory.listFiles();
  if (files == null) {
    return BigInteger.ZERO;
  }
  BigInteger size=BigInteger.ZERO;
  for (  final File file : files) {
    try {
      if (!isSymlink(file)) {
        size=size.add(BigInteger.valueOf(sizeOf(file)));
      }
    }
 catch (    IOException ioe) {
    }
  }
  return size;
}

public static BigInteger sizeOfDirectoryAsBigInteger ( File directory ) { checkDirectory ( directory ) ; final File [ ] files = directory . listFiles ( ) ; if ( files == null ) { return BigInteger . ZERO ; } BigInteger size = BigInteger . ZERO ; for ( final File file : files ) { try { if ( ! isSymlink ( file ) ) { size = size . add ( BigInteger . valueOf ( sizeOf ( file ) ) ) ; } } catch ( IOException ioe ) { } } return size ; }
counts the size of a directory recursively ( sum of the length of all files ) .
