Package com.zybooks.dsaj.recursion
Class DiskSpace
java.lang.Object
com.zybooks.dsaj.recursion.DiskSpace
Supports the computation of the total disk space usage within a file system.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic long
Calculates the total disk usage (in bytes) of the portion of the file system rooted at the given path, while printing a summary akin to the standard 'du' Unix tool.static void
Computes disk usage of the path given as a command line argument.
-
Constructor Details
-
DiskSpace
public DiskSpace()
-
-
Method Details
-
diskUsage
Calculates the total disk usage (in bytes) of the portion of the file system rooted at the given path, while printing a summary akin to the standard 'du' Unix tool.- Parameters:
root
- designates a location in the file system- Returns:
- total number of bytes used by the designated portion of the file system
-
main
Computes disk usage of the path given as a command line argument. Sample usage: java DiskSpace C:\Users\Michael
-