Class DittoDiskUsageItem
java.lang.Object
com.ditto.java.DittoDiskUsageItem
Represents a directory or file in the Ditto working directory.
This class provides information about disk usage for a specific item within Ditto's
data directory. Directories can be traversed by accessing getChildren().
Regular files will have no children.
-
Method Summary
Modifier and TypeMethodDescriptionboolean@Nullable List<? extends DittoDiskUsageItem> Returns a list of child items.@NonNull StringgetPath()Returns the path to this item relative to the Ditto working directory.intReturns the size of this item in bytes.@NonNull DittoFileSystemTypegetType()Returns the type of this item (file or directory).inthashCode()
-
Method Details
-
getType
Returns the type of this item (file or directory).- Returns:
- the
DittoFileSystemTypeindicating whether this is a file or directory.
-
getPath
Returns the path to this item relative to the Ditto working directory.- Returns:
- the relative path string.
-
getSizeIntBytes
public int getSizeIntBytes()Returns the size of this item in bytes.
For files, this is the file size. For directories, this is the sum of all file sizes beneath it, including all subdirectories.
- Returns:
- the size in bytes.
-
getChildren
Returns a list of child items.
For directories, this returns a list of all items (files and subdirectories) contained within. For regular files, this returns
nullor an empty list.- Returns:
- a list of child
DittoDiskUsageItems, ornullfor files.
-
hashCode
-
equals
-