org.apache.cassandra.utils

## Class DirectorySizeCalculator

- java.lang.Object
- - java.nio.file.SimpleFileVisitor<java.nio.file.Path>
  - - org.apache.cassandra.utils.DirectorySizeCalculator

All Implemented Interfaces:
  java.nio.file.FileVisitor<java.nio.file.Path>

    public class DirectorySizeCalculator
    extends java.nio.file.SimpleFileVisitor<java.nio.file.Path>

Walks directory recursively, summing up total contents of files within.

### Field Summary

Fields
`protected java.io.File` `path`
`protected long` `size`

### Constructor Summary

Constructors
Constructor and Description
`DirectorySizeCalculator(java.io.File path)`

### Method Summary

All Methods Instance Methods Concrete Methods
`long` `getAllocatedSize()`
`boolean` `isAcceptable(java.nio.file.Path file)`
`java.nio.file.FileVisitResult` `visitFile(java.nio.file.Path file, java.nio.file.attribute.BasicFileAttributes attrs)`
`java.nio.file.FileVisitResult` `visitFileFailed(java.nio.file.Path file, java.io.IOException exc)`

### Methods inherited from class java.nio.file.SimpleFileVisitor

`postVisitDirectory, preVisitDirectory`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### size

    protected volatile long size

#### path

    protected final java.io.File path

### Constructor Detail

#### DirectorySizeCalculator

    public DirectorySizeCalculator(java.io.File path)

### Method Detail

#### isAcceptable

    public boolean isAcceptable(java.nio.file.Path file)

#### visitFile

    public java.nio.file.FileVisitResult visitFile(java.nio.file.Path file,
                                                   java.nio.file.attribute.BasicFileAttributes attrs)
                                            throws java.io.IOException

Specified by:
  `visitFile` in interface `java.nio.file.FileVisitor<java.nio.file.Path>`
Overrides:
  `visitFile` in class `java.nio.file.SimpleFileVisitor<java.nio.file.Path>`
Throws:
  `java.io.IOException`

#### visitFileFailed

    public java.nio.file.FileVisitResult visitFileFailed(java.nio.file.Path file,
                                                         java.io.IOException exc)
                                                  throws java.io.IOException

Specified by:
  `visitFileFailed` in interface `java.nio.file.FileVisitor<java.nio.file.Path>`
Overrides:
  `visitFileFailed` in class `java.nio.file.SimpleFileVisitor<java.nio.file.Path>`
Throws:
  `java.io.IOException`

#### getAllocatedSize

    public long getAllocatedSize()