Added getSize() method for calculating directory sizes.