Class DittoDiskUsageItem

java.lang.Object
com.ditto.java.DittoDiskUsageItem

public final class DittoDiskUsageItem extends Object

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 Details

    • getType

      public @NonNull DittoFileSystemType getType()
      Returns the type of this item (file or directory).
      Returns:
      the DittoFileSystemType indicating whether this is a file or directory.
    • getPath

      public @NonNull String 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

      public @Nullable List<? extends DittoDiskUsageItem> 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 null or an empty list.

      Returns:
      a list of child DittoDiskUsageItems, or null for files.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object